[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Moving Debian from one HD to another



Here's a procedure I use courtesy of Joel Maslak and it works well. You 
can modify it slightly as I did. I use boot disks and when copying the 
whole HD I haven't had any problems booting or running from either HD. I 
do have to modify the /etc/fstab of the target HD so it will boot correctly.
Dick Arnold

 ---------- Forwarded message ----------
Date: 6 Oct 95 10:56:39 MDT
From: Joel Maslak <jmaslak@uwyo.edu>
Newgroups: comp.os.linux.help, comp.os.linux.setup, comp.os.linux.admin,
    comp.os.linux.misc
Subject: Re: How to make exact copy of a harddrive?


To: orc@pell.com (Orc)
Subject: Re: How to make exact copy of a harddrive?
Newsgroups: comp.os.linux.help,comp.os.linux.setup,comp.os.linux.admin,comp.os.linux.misc
Organization: Not Likely!

Everyone knows what said, but I didn't see my method, which copies links 
fine, devices fine, etc:

#! /bin/sh
/sbin/umount -a

(BUT make sure you keep whatever you DO need mounted.  Everything I use 
is just on my root partition, so the above line works fine)
YOU DO NOT WANT THE OTHER HARDDRIVE MOUNTED WHEN THIS BEGINS!  TRUST ME!
It's also useful to unmount CD-ROMS, tapes, etc!

cd /
/usr/bin/find ./ > /tmp/files

Some finds are a little different.  This is Linux/Slackware find.

/sbin/mount -a
cat /tmp/files | /bin/cpio -p -d -m --b=16 /backup

Some cpio's are different, but this works for me!  (NOTE: the mount 
command above mounts my second hard drive - the backup drive - on /backup)

Find uses the list of files in /tmp/files to make the backup.

/bin/rm /tmp/files
/bin/rm /backup/tmp/files # Optionally, you may want to keep this if you 
want a catalog.

/bin/echo Backup Complete!
sync; sync; sync

(Some superstition there!)

I usually unmount the /backup partition, too, just in case!

This method is great!  The second HD is EXACTLY like the first, as far as 
the data level, but it can be different on the actual physical level 
(I.E. you can copy your 400 meg drive onto a 1.2 gig drive...  :)

Restoring is EASY.  Just mount the drive and cp the files you need! :)

Also, it doesn't require a large temporary file - just a list of files on 
the drive.

Hope it helps!

(OH, BTW: It'd be best to bring the system to single user mode when you 
do this - telinit 0, on some systems)

--
Joel Maslak

I am Pentium of Borg.
Division is futile.
You will be approximated.




Reply to: