Safely transfer data between partitions
Q I recently installed Fedora on to my Dell 510M laptop, in a dual-boot setup with Windows XP, and it's giving me a problem. One of the Linux partitions (/) is nearly full, while the other one (/home1) is almost empty. I used Partition Magic 8.0 on the XP partition to resize it before installing FC 3, but I've used PM on another PC to resize a Linux partition and it messed up the whole Linux partition - it didn't boot anymore and I had to reinstall everything from scratch - so I'm reluctant to use PM again. On the Linux partition of my laptop I have installed QtParted, but this doesn't allow me to manipulate a mounted partition. I can see the settings, but can't change them. How do I safely transfer unused space from the /home1 partition to the / partition without destroying my Linux installation or losing data? I've spent so much time installing and configuring everything on this machine and I really don't want to have to re-do it from scratch.
A As you are using partitions rather than volumes, it's very difficult to resize them without wiping everything out. A smart option is to back everything up prior to altering the partitions, or even to copy everything to a second disk (or the Windows partition if it is not NTFS-based) and then go back to the beginning and install Linux again. I would recommend that when installing Linux for the first time you create a separate /home partition in addition to the mandatory / (root) and swap partitions. In this way data is separated from the system so you can do an update or a complete reinstall while keeping your data safe. If QtParted isn't working, you might consider using resize2fs to shrink ext2 or ext3 filesystems then change the partition structure around, but it's hit or miss whether you actually adjust the partition correctly this way. To resize the filesystem on /dev/hda1 to 512MB, you would issue the following command as root:
resize2fs /dev/hda1 512M
Unmounting is a good idea prior to making any changes that modify the structure of the filesystem.
Follow us on Identi.ca or Twitter