2

OK so I am a freelance sysadmin. I was asked to resize root partion (/) because it was 20Gb and /home was 3Tb.

What I wasn't told is that the server is using RAID and GPT, so I can't use fdisk but will have to use parted, and I don't know if RAID will come into play.

Here is all the parted, df -h, and fstab: http://pastebin.com/RFbQL0qV

Can anyone help ?

thms0
  • 71

3 Answers3

2

As you are using EXT4, it should be possible to shrink the /home/ partition. Let do an example shrinking it to about 2 TB:

  1. unmount your filesystem with umount /dev/md3
  2. check your filesystem with fsck /dev/md3
  3. resize the filesystem with resize2fs /dev/md3 1800G
  4. resize the RAID device with mdadm --grow /dev/md3 --size=1900G Please note that I left the array bigger than the underlying filesystem, by a great margin. This is because the last thing you want is to shrink too much your array, at a point where the underlying filesystem can't fit in it. This is a very bad scenario, with almost 100% guaranteed data loss.
  5. recheck your filesystem with fsck /dev/md3
  6. remount your filesystem and try to read/write to/from it.

Here you can find some other information.

Anyway, if your /dev/md3 device is almost empty, maybe destroying/recreating the array/partitions can both be easier and faster.

shodanshok
  • 52,255
0

This should be fun. Boot from a rescue disk and use resize2fs to shrink the /home filesystem in the raid array, then mdadm -z to shrink the size of the raid array, then mdadm -f -r to fail and remove one of the two drives from the raid arrays. Use parted on the drive you removed to delete the partitions and recreate them with the changed size you want. Then use mdadm --add to add the partition on the second drive back into the arrays, and wait for it to resync. Then fail and remove the first drive from the array, repartition the same way you did the second drive, and re-add and wait for it to resync. Finally, use mdadm -z again to increase the usable size of the root raid array, and resize2fs on it to expand the filesystem to use that space.

psusi
  • 3,447
  • 1
  • 19
  • 9
0

OK, just seen your answers, thanks everyone for your input. Right now, I am gonna do a NFS and rsync -avPH to do a full backup of the system. Also saved the full packages list that are installed. I will try your solution, if it fails I will reinstall and just rsync back.

I'll update later.

Thanks a lot for answering, anyway :).

thms0
  • 71