Making a drive image
Hi
At our company we have a mandrake system (9.1) which originally only had a 40 GB hardrive. Later we bough a another 80GB drive. Problem is that the 40GB with the / and home partitions is now getting rather full. The 80BG drive contains mostly backups. What I would like to do is to swap the contents of the drives around. That is putting the / and home directorties on the 80GB and put backups on the 40GB. So I guess I'll need to make an image of the drive and place that image on the 80GB drive. First of all, I would like to know if this is possible and safe? Second, what tools can be used to do this? Thanks in advance |
This is possible and (at least theoretically) safe.
You will need to look closely at the partitions of both drives. This is something that must be done on a partition-by-partition basis, not a drive-by-drive basis. First of all, create a rescue disk and make sure that you can boot into it. Next, I would recommend finding out how to reinstall your bootloader; this is something that you will need to do after moving partitions around so it's probably easiest to do it first. For lilo this is as simple as typing Code:
/sbin/lilo Take a backup of your system, in case you delete something you shouldn't. gnuparted would be a useful program here, as it lets you resize and copy partitions without deleting their contents. Use this rather than fdisk. To create an image of a partition, you can use Code:
cat /dev/device | bzip2 > image.bz2 Code:
bzcat image.bz2 > /dev/device Code:
cp -dprx /path-from /path-to After changing the partitions around, you will need to update the /etc/fstab file to point to the new locations of each mount-point. I would advice making a written plan of how you want to do this before you start in case you end up overwriting something you shouldn't. You will probably have at least one swap partition; this can be safely deleted. You can create a new swap partition using Code:
mkswapfs /dev/device |
Thanks for your reply.
It seems that this is much easier than it would be on a windows box ;-) I'll try it soon. Cheers |
Hm, I would wipe the 80 Gig, make a e3fs, copy everything over using rsync, write a new fstab and bootloader config, install the boot loader, and physically swap the drives, just incase something is pointing to /dev/hda when it is on /dev/hdb. This way you don't have to mess with any of the partions, which is really scary. Atleast you're not wiping the 40 gig so if you fsck up, you will be ok. =)
|
All times are GMT -5. The time now is 03:58 AM. |