2

I added three new drives to a Dell 2950 (running RHEL 5) with a PERC 6/i storage controller. The machine was previously running RAID 1 on two drives + hotswap. Rather than create an identical RAID 1 array with the new drives, I opted to gain additional storage by using OpenManage to convert the original Virtual Drive to a RAID 5 array that incorporated the new drives.

All of the above went off without a problem, but when I try to create a new partition with the additional space, fdisk informs me that there are "No free sectors available", even though it seems to recognize the additional space.

My current filesystem usage:

[root@local ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.7G  2.1G  7.1G  23% /
/dev/sda1             487M   35M  427M   8% /boot
none                  4.0G     0  4.0G   0% /dev/shm
/dev/sda3             487M   11M  451M   3% /tmp
/dev/sda5             4.9G  1.2G  3.5G  25% /usr
/dev/mapper/VarGroup-var
                      50G  757M   47G   2% /var

fdisk output, showing additional disk space:

[root@local ~]# fdisk -l

Disk /dev/sda: 290.9 GB, 290984034304 bytes
255 heads, 63 sectors/track, 35376 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      514048+  83  Linux
/dev/sda2              65        1339    10241437+  83  Linux
/dev/sda3            1340        1403      514080   83  Linux
/dev/sda4            1404        8844    59769832+   5  Extended
/dev/sda5            1404        2040     5116671   83  Linux
/dev/sda6            2041        2301     2096451   82  Linux swap
/dev/sda7            2302        8844    52556616   8e  Linux LVM

Is there any way to incorporate the additional disk space without destructive repartitioning?

rvf
  • 1,435
  • 1
  • 13
  • 9

3 Answers3

3

PC partition formats were decided 30+ years ago and aren't particularly flexible. You can only have four primary partitions, numbered 1 to 4. If you want more than four partitions, one of them must be an extended partition (sda4 in your setup); an extended partition is a container that contains any number (well, up to 11 in Linux under most common setups) of logical partitions.

You currently have 3 primary partitions (sda1 through sda3), so you can only create new logical partitions. But the extended partition is full, so there is no room for these new logical partitions. This explains fdisk's cryptic message.

As far as I remember, fdisk can't extend an extended partition. Try parted or cfdisk instead. Extend the extended partition (sda4) to range until the end of the disk, and create a new logical partition in the space now available.

  • That did the trick. Resized the extended partition with parted and I was able to create additional logical partitions. – rvf Sep 01 '10 at 20:47
1

Have you considered reorganizing the disks and using LVM over all the disk and manage the subdivision volume into seperate mount points?

mdpc
  • 11,698
  • 28
  • 51
  • 65
1

I don't know what you mean by "destructive repartitioning" but you can use fdisk without losing data. Boot off a CD, delete paritions sda[4-7], recreate sda4 with all of the free space, recreate sda[5-6] with exactly the same size as before (note: exactly), create sda7 with the remaining space and then run pvresize to inform lvm of the new size of sda7.

This way you will not lose any data unless an error occurs. Errors do occur so have backups.

Mark Wagner
  • 17,764
  • 2
  • 30
  • 47
  • Yikes. I had an inkling that might be possible, but potentially risky if only for the small margin of error. I have full backups; my main concern is time. This is a test run for a different, identical machine where extended downtime is the major concern. Using parted seems a little more forgiving, but I will try this method if parted doesn't work out. – rvf Aug 31 '10 at 01:46
  • 2
    having tried that in the past, I noticed that sometimes `fdisk` recreates partitions with a slightly different size (±63 sectors) (using the main menu with cylinder addresses). That, in addition to the potential for mistakes when copying the figures, makes me advise against this method. – Gilles 'SO- stop being evil' Aug 31 '10 at 07:07