Re: [SLUG] repartitioning

From: Kwan Lowe (kwan@digitalhermit.com)
Date: Sat Aug 13 2005 - 18:42:44 EDT


> What I plan to do is replace /dev/hda5 with a smaller partition, and use the
> newly-freed space to hold /export/media/mp3 (5.3GB). /export currently has
> about 900MB free space; moving the MP3s to their own partition will increase
> /export's free space to over 6 gigs.
>
> My plan of attack is this:
>
> *DISABLE NIGHTLY BACKUP*
> delete hda5 (renumbers hda6-hda12 to hda5-hda11)
> create new partition hda12 cylinders 8000-12000 for /mnt/old (>= 30G)
> create new partition hda13 cylinders 12001-15017 for /export/music/mp3
> write & exit
> modify /etc/fstab, /etc/auto.misc & decr any partition # > 5 (hda5 -> hda12
> but comment it out)
> reboot into runlevel 1
> mkfs -t reiserfs /dev/hda12
> mkfs -t reiserfs /dev/hda13
> uncomment hda5 in /etc/fstab
> add hda13 (/export/music/mp3) to /etc/auto.misc
> copy /dev/hdb5 (/mnt/temp) -> /dev/hda12 (/mnt/old)
> copy /export/media/mp3 -> /dev/hda13 (/mnt/temp)
> rm -r /export/media/mp3
> mkdir /export/media/mp3
> reboot
> *RE-ENABLE BACKUP*
> enjoy!
>
> Is there a tool that'll resize a partition without changing its numbering?
> That would make things simpler. If not, have I missed any steps?
>

A couple things that might be problematic:

Check if your bootloader is using disklabels rather than hard partitions for the
filesystems. Your fdisk output does not appear to use labels but you can verify
this. If not, changing the partition number won't affect what the partition gets
mounted as.

Re-writing a partition map where you have modified partition sizes can zap
everything on the disk. (!!!)

BTW, have you considered using LVM instead? It's very easy to configure and helps
avoid this problem in the future. I put up some notes at
http://www.digitalhermit.com/linux/lvm . In your case you could remake the hda5
partition into an LVM partition then suballocate it and grow the fs later. That
you're using ReiserFS is also helpful, since you can resize on the fly in the
future.

-- 
* The Digital Hermit   http://www.digitalhermit.com
* Unix and Linux Solutions   kwan@digitalhermit.com
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:00:37 EDT