[ Bloke.com || Linux || JavaScript || Java || Volleyball || Link Me ]
Free: [ Guestbook || MessageBot || Plugins || Counter || AusPrices || Advertise ]

Home - Linux - Partition

Allocating unused space: Somestimes redhat doesn't use all the of the disk space on a drive during the standard install. These instructions show how to add the extra partition. Warning There are many dangerous commands here, some will delete all the data on your drive, others may just corrupt it, rendering it useless. So my advice is don't do this, but should you continue, then backup all your data before you start. make the machine as quiet as you can ... run:
fdisk /dev/hda
or 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 swap
here 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

Resizing Partitions