My server is version 7.2 updated with latest updates as of today. I have a Hardware RAID1 device, so the OS and motherboard sees only a single disk. I had (2) 120 GB drives in the device and was getting low on space. So I added two new 300 GB drives one at a time and refreshed the mirror. I now have two 300GB disks in the device that are partitioned as 120 GB, therefore I have about 180 GB of unallocated space that I would like to recover.
I read an old post a while back that describes how to do this on an older version of SME.
http://forums.contribs.org/index.php?topic=25017.0 It is not exactly my scenario but seems pretty close. My question do I have to do more than Step 2? Or is there a better way to do this?
I hope this is clear enough..let me know if you need more information.
Edit:
After posting this I found
http://wiki.contribs.org/Raid. Which gives some information about resizing the disk on the fly..However, it too is very close but not exactly what I need. Here is the relevant information in the page:
Upgrading the Hard Drive Size
CAUTION MAKE A FULL BACKUP!
Ensure you have e-smith-base-4.16.0-33 or newer installed. [or Update to at least 7.1.3]
Shut down and install larger drive in system.
Boot up and manage raid to add new (larger) drive to system.
Wait for raid to fully sync.
Repeat steps 1-3 until all drives in system are upgraded to larger capacity.
Ensure all drives have been replace with larger drives and array is in sync and redundant!
Issue the following commands:
mdadm --grow /dev/md2 --size=max
pvresize /dev/md2
lvresize -l +$(vgdisplay -c main | cut -d: -f16) main/root [-l (lower case L)]
ext2online -C0 /dev/main/root [is -C0 (zero)]
Notes :
All of this can be done while the server is up and running with the exception of #1.
These instructions should work for any raid level you have as long as you have >= 2 drives
If you have disabled lvm
you don't need the pvresize or lvresize command
the final line becomes ext2online -C0 /dev/md2 (or whatever / is mounted to)
I dont think this will work for me as my cat /proc/mdstat yields:
Personalities : [raid1]
md2 : active raid1 hda2[0]
117113728 blocks [2/1] [U_]
md1 : active raid1 hda1[0]
104320 blocks [2/1] [U_]
And my df yields:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/main-root
113275568 67403020 40121764 63% /
/dev/md1 101018 47184 48618 50% /boot
none 1037040 0 1037040 0% /dev/shm
So I guess I am wondering how to modify the commands from the how-to to recover the space as described in the beginning of the post.
Just in case your wondering...I off loaded a ton of info to a local computer to free up the space you know see in the 'df' output, As soon as I get the new drive properly sized I will put all that info back on the server.
Thanks for all your help.
Sincerely,
Rick Evans
Here is a little more information:
The fdisk output the new drive(s) (the 300GB drives) in the RAID device:
[root@matrix ~]# fdisk /dev/hda
The number of cylinders for this disk is set to 14593.
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): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): p
Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 fd Linux raid autodetect
/dev/hda2 14 14593 117113850 fd Linux raid autodetect
Command (m for help):