- http://www.howtoforge.com/how-to-resize-raid-partitions-shrink-and-grow-software-raid
- http://michael-prokop.at/blog/2006/09/09/raid5-online-resizing-with-linux/
- https://raid.wiki.kernel.org/index.php/Growing <----- This is the best one.
- Make sure you add a small <5MB partition for the boot loader as these are the boot disks
# gdisk -l /dev/sdc
GPT fdisk (gdisk) version 0.5.1
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdc: 1953525168 sectors, 931.5 GiB
Disk identifier (GUID): 1213CECB-D072-12C2-4846-60804FA91405
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 1953525134
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 34 6144 3.0 MiB EF02 BIOS boot partition
2 6145 1953525134 931.5 GiB FD00 Linux RAID
- Set the grub_bios flag on the small partition
sudo parted /dev/sdc set <partition_number> bios_grub on
- Once you have swapped out the disks each time, re-sync-ed and grown the raid.
Boot via a rescue disk and fsck the raid metadevice and then resize the filesystem.
e2fsck -f /dev/md0
resize2fs /dev/md0
mkdir /tmp/a
mount /tmp/a /dev/md0
df -h
- Reboot and you are done.
# df -h | egrep "md|Filesys"
Filesystem Size Used Avail Use% Mounted on
/dev/md0 917G 8.0G 863G 1% /
/dev/md2 1.8T 456G 1.3T 27% /data
Resync on the old disks
md0 : active raid1 sdd1[2] sdc1[0]
74920896 blocks [2/1] [U_]
[>....................] recovery = 2.6% (2012992/74920896) finish=41.5min speed=29240K/sec
74920896 blocks [2/1] [U_]
[>....................] recovery = 2.6% (2012992/74920896) finish=41.5min speed=29240K/sec
Resync on the new
md0 : active raid1 sdd2[1] sdc2[0]
976759424 blocks [2/2] [UU]
[=>...................] resync = 8.1% (79639488/976759424) finish=181.6min speed=82296K/sec
976759424 blocks [2/2] [UU]
[=>...................] resync = 8.1% (79639488/976759424) finish=181.6min speed=82296K/sec
Some what faster - and a hell of a lot quieter.
No comments:
Post a Comment