[
Bloke.com
|| Linux
|| JavaScript
|| Java
|| Volleyball
|| Link Me
]
Free: [ Guestbook || MessageBot || Plugins || Counter || AusPrices || Advertise ] |
fdisk /dev/hdaor the device of the disk that you want to add the partitions on... do a "df -k" to get the list of devices. If you have scsi disks , it'll be /dev/sda or /dev/sdb etc...
Now that you are running fdisk, type 'm' to show help, 'p' to print the partition table.
Now remember that /dev/hda2 is usally the whole disk (look at the start and end) but it can be a little tricky, but I believe that when you see "Extended" it's a logical partitioning thing .. anyway .. basically this doesn't mean the disk is used. now look for the start and end and look for holes
Device Boot Start End Blocks Id System /dev/hda1 * 1 3 24066 83 Linux /dev/hda2 4 2491 19984860 5 Extended /dev/hda5 4 1137 9108823+ 83 Linux /dev/hda6 1138 2271 9108823+ 83 Linux /dev/hda7 2272 2304 265041 83 Linux /dev/hda8 2305 2337 265041 83 Linux /dev/hda9 2338 2491 1236973+ 82 Linux swaphere you see hda2 goes from 4 - 2491
but you also see no holes in my partition table.
so now you need to add partitions. 'n' to add a new partition
you will get logical (l) or primary (p)
you see above that I have two primary partiions 1 and 2 (they are 1-4) and the rest are logical. Probably you have a whole in primary partition 2, so press 'l' to add a logical partition
then (at this point, I can't test) I think it asks for starting and ending cylinders or sectors or whatever.... the defaults will usually try to use up the remaining space. Modify to suit your needs.
When you are done, use 'w' to write the table to disk and exit.
Once you have done this you need to make a file system on it. Warning, this will delete all the data on the partition! so make sure you get the correct new number
just use mkfs /dev/hdaXX where XX is the new device
and it might be /dev/sdaXX for scsi disks.
This would generate an ext2 file system man mkfs on other file types.
then add to /etc/fstab
bash-2.05$ df -k Filesystem 1k-blocks Used Available Use% Mounted on /dev/hda3 10238812 4757716 4960992 49% / /dev/hda2 46668 11176 33083 26% /boot none 256408 0 256408 0% /dev/shm /dev/hda1 8024288 7286356 737932 91% /win2000 bash-2.05$ cat /etc/fstab LABEL=/ / ext3 defaults 1 1 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0 /dev/hda5 swap swap defaults 0 0 /dev/cdrom /mnt/cdrom iso9660 noauto,owner,kudzu,ro 0 0 /dev/hda1 /win2000 vfat defaults 1 2 bash-2.05$But in my case I also need to make sure that this partition is on the first 8.5 Gig's of space on the disk (requirement for hibernation). So I use fdisk to figure things out.
bash-2.05$ su - Password: [root@tiger root]# fdisk /dev/hda The number of cylinders for this disk is set to 2432. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Command (m for help): p Disk /dev/hda: 255 heads, 63 sectors, 2432 cylinders Units = cylinders of 16065 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 * 1 1001 8040501 b Win95 FAT32 /dev/hda2 1002 1007 48195 83 Linux /dev/hda3 1008 2302 10402087+ 83 Linux /dev/hda4 2303 2432 1044225 f Win95 Ext'd (LBA) /dev/hda5 2303 2432 1044193+ 82 Linux swap Command (m for help):I have a 20gig drive, so the blocks are 1k each. As you can see, if I want to find extra space for this partition, it'll have to be in the Win2000 partition. Everybody recommends Partition Magic to do such things. I have enough free space on this partition, but only just. However I know that this partition already has a 512MB or so hibernation file (which doesn't work). So if I go back into windows, I can go into ControlPanel -> Power Settings -> Hibernate Tab and turn off hibernation to free up this space.
I'm probably going to try to split the swap file and hope the first 8.5 gig's requirement is not correct. Should be "relatively" safe thing to do, since I rarely use the 1Gig of swap space that I have.
I grabbed parted from ftp://ftp.gnu.org/gnu/parted/ which will resize/copy etc certain partition types. My partion types are Fat32, ext2, and ext3. Although the documentation says it only supports detect for ext3, the changelog says it now supports ext3 resizing. Sounds scarey? Yep, be careful what you do!
More to come...
Last Change: Monday, 10-Jan-2005 07:41:32 EST
Disclaimer
The information provided within these pages is provided AS IS, and without any
warranty. Following these directions may (but not limited to)
crash your computer, delete all the information on your hard disk, open up security holes or cause your house to burn down.
I made these pages to provide some information about the setup that I have done,
but I did not proofread it for correctness, and in most cases did not test it.
There are commands in these pages that would definately delete or corrupt all
the data on your computer (especially the dualboot section). In fact it happened
to me....
So you are on your own!