Help - Search - Members - Calendar
Full Version: Copying A Partition
Linuxhelp > Support > Technical Support
I've been trying to copy a partition (hda6 to hda7) and so far have had no luck. At first I thought I would just make an obesely large image file of 6 with dd, the reverse it into 7, but it turns out that singles files are limited to 2 gigs, at least on a fat32 partition. I guess I should explain how I'm doing this. I copy the image file onto one of my windows partitions wich is like 40gigs or something (ample space to put an eight gig file on). Then from there I would put the image onto the hda7 partition, but since I couldn't get the image, it won't work. After that I tried using some crappy program called parted, but it has little documentation, and the --help tag is very cryptic. I did get it to start once, but it gave me something about one of the drives was in incompatibility mode, or something like that. If anyone has a better program/method to suggest I would really appreciate it.


PS. I'm doing this because I want to put FreeBSD on my system, but it requires a primary, which can't appear after a logical partition, like my linux partitions are. So my plan was to copy my existing slackware installation onto hda7 and then alter fstab and lilo.conf, and a couple other things to get it to work properly.
After you created a new Linux part with cfdisk, fdisk, parted, do

mkfs /dev/hda7
* while booted to hda6 *
mkdir /mnt/hda7
mount /dev/hda7 /mnt/hda7
cp -a /bin /boot ...*includes all top directories*... /mnt/hda7
I understand what your trying to say there, but I actually tried something similar to that. I just did a straight copy like this

cp /dev/hda6 /dev/hda7

But it didn't work for boot. I think the problem is a little lower level than just copying files from one partition to another. It's probably in the boot sector of the partition (I think like the first 512 bytes). It's hard to say.

Another thing I was thinking of was doing a direct image copy. I hadn't thought of this before (I wanted to make an image file then copy it to the second partition). I guess you could try this:

dd if=/dev/hda6 of=/dev/hda7

But again I think I would have the trouble with my boot sector. If anyone has any tried and true methods it would be helpful, but hey... what's the worse that could happen? Reinstall Linux again? Bwah hah hah ha! I've probably installed linux like 10 times in the last month or so. Anyway, I'm babbling now so I'll shut up.


PS. Oh yeah, BTW the two partitions are identical in size, so that's the reason why it would work to do a direct image copy. Guess I forgot to mention that.
I don't think you should bother with dd if you're copying the boot sector. It will probably not work because the physical location changed.

If you want pure backup for boot sector,

dd if=/dev/hda6 of=/linux.lnx bs=512 count=1

Don't copy it to /dev/hda7 boot sector. Keep it for backup. After you're done and recovering your system, do

dd if=/linux.lnx of=/dev/hda6

If you must migrate hd6 to 7,

edit /etc/lilo.conf
lilo -v
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.