Just somewhere to keep my notes while I'm playing.

Friday, March 15, 2013

File System Manipulation

Extending a 'normal' fdisk partition

The Task
We have a server with ext3 files systems. The file systems for root (/) and usr (/usr) are 4GB and need to be increased to 8GB.
  1. use fdisk to create a new partition of the correct size
  2. dd if=/dev/sda5 of=/dev/sda10
  3. e2fsck -f /dev/sda10
  4. resize2fs /dev/sda10
  5. e2label /dev/sda5 "oldroot"
  6. Reboot the system
Note: The above example assumes that you are using labels in /etc/fstab. If you are using UUID you will have to edit /etc/fstab. Actually - UUIDs are copied across, so we need to work a little harder on these.

No comments: