# This is the expansion of the partition and filesystem onto the already # expanded RAID5 array. # Comments are added later to explain what is going on # Note that the RAID expansion shown in the previous pictures took about 36 # hours but ran in the background. Script started on Sun Jul 6 11:49:28 2008 asylum# cd /root # this is the before asylum# df -hTP /home/asylum/kmk/media Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 xfs 2.8T 2.7T 54G 99% /home/asylum/kmk/media asylum# umount -v /home/asylum/kmk/media /dev/sda1 umounted # This is to force the kernel to notice that the disk is now bigger. It will # not actually touch the disk as we can't use *fdisk for much else. # Of course you could reboot for the same effect but that would suck. asylum# sfdisk -R /dev/sda # this is just to show the existing GPT table. Because the array is >2TB GPT # and parted must be used instead of fdisk. asylum# parted /dev/sda Warning: GNU Parted has detected libreiserfs interface version mismatch. Found 1-1, required 0. ReiserFS support will be disabled. GNU Parted 1.8.8 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 1953124864 blocks) or continue with the current setting? Fix/Ignore? i Model: Areca Asylum Media R5 (scsi) Disk /dev/sda: 4000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 3000GB 3000GB xfs (parted) quit # This is the very scarry part.... asylum# parted /dev/sda Warning: GNU Parted has detected libreiserfs interface version mismatch. Found 1-1, required 0. ReiserFS support will be disabled. GNU Parted 1.8.8 Using /dev/sda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Warning: Not all of the space available to /dev/sda appears to be used, you can fix the GPT to use all of the space (an extra 1953124864 blocks) or continue with the current setting? Fix/Ignore? f Model: Areca Asylum Media R5 (scsi) Disk /dev/sda: 4000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 3000GB 3000GB xfs (parted) resize 1 0 100% No Implementation: Support for opening xfs file systems is not implemented yet. # Unfortunately parted wants to control both the partition table and the # filesystem instead of just doing the partition table like fdisk does. # Because it insists on doing filesystem operations but cannot support XFS # resizing (since XFS filesystems must be mounted to be resized) it can't just # do a resize. Instead we must delete the existing partition (YIKES!) and # create a new one that starts in the same place. (parted) rm 1 (parted) mkpart 1 0 100% (parted) p Model: Areca Asylum Media R5 (scsi) Disk /dev/sda: 4000GB Sector size (logical/physical): 512B/512B Partition Table: gpt Number Start End Size File system Name Flags 1 17.4kB 4000GB 4000GB xfs (parted) quit Information: You may need to update /etc/fstab. asylum# mount -v /home/asylum/kmk/media /dev/sda1 on /home/asylum/kmk/media type xfs (rw,noatime,nodiratime) asylum# df -hTP /home/asylum/kmk/media Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 xfs 2.8T 2.7T 54G 99% /home/asylum/kmk/media # Note that the df still looks the same because we forced parted to only # operate on the partition table. That means we still have to expand the # filesystem. Luckily with XFS that is fast and simple... asylum# time xfs_growfs /home/asylum/kmk/media meta-data=/dev/sda1 isize=256 agcount=32, agsize=22888181 blks = sectsz=512 attr=0 data = bsize=4096 blocks=732421792, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 log =internal bsize=4096 blocks=32768, version=1 = sectsz=512 sunit=0 blks, lazy-count=0 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 732421792 to 976562423 0.000u 0.012s 0:00.46 2.1% 0+0k 0+0io 2pf+0w # Less than half a second! asylum# df -hTP /home/asylum/kmk/media Filesystem Type Size Used Avail Use% Mounted on /dev/sda1 xfs 3.7T 2.7T 985G 74% /home/asylum/kmk/media # It worked!!!!!! Script done on Sun Jul 6 11:54:31 2008