Bill Jonas on Wed, 5 Jul 2000 17:42:47 -0400 (EDT)


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

Re: [PLUG] copying a complete system to new HD


On Wed, 5 Jul 2000, Jason Staloff wrote:

>When I copy everything but /dev to the new drive and try to boot, it
>starts to boot off the drive but it's unable to initialize a console.

That's to be expected if there's no /dev/ directory with the proper
device files in it, since Un*x represents everything as a file.

>Tar seems to work: I just tried it on my notebook and I got an archive
>with my /dev in it. I'll try it on the new drive when I get home.

It seems to work for me:
bj@morpheus:/$ sudo mkdir newdev
bj@morpheus:/$ sudo cp -a /dev/ /newdev/
bj@morpheus:/$ diff <(ls /dev/) <(ls /newdev/dev/)
bj@morpheus:/$

Doing an 'ls -l' in place of the simple 'ls' in the above sequence only
shows differences in the modification times of symbolic links.

I noticed that you said you were using 'cp -pdr'... note that the case
of the R is quite important WRT this.  Here's a snippet from the cp man
page:

       -r     copy recursively, non-directories as files WARNING:
              use -R instead when you might copy special files
              like FIFOs or /dev/zero

Also note that there is generally a /dev/MAKEDEV script which will
create the device files properly for you (but it takes options, and I
can't advise since I've not used it; it might also be distribution
dependent, but I'm not sure).

Note, though, that your use of 'cp -a' is dependent upon you having a
copy of GNU cp on the system on which you're working.  'cd ... && tar
...' is rather Un*x-independent.

Bill
-- 
>Ever heard of .cshrc?             | "Linux means never having to delete
That's a city in Bosnia. Right?    |  your love mail." -- Don Marti
(Discussion in comp.os.linux.misc  |  http://www.billjonas.com/
on the intuitiveness of commands.) |  http://www.harrybrowne.org/



______________________________________________________________________
Philadelphia Linux Users Group       -       http://plug.nothinbut.net
Announcements - http://lists.nothinbut.net/mail/listinfo/plug-announce
General Discussion   -   http://lists.nothinbut.net/mail/listinfo/plug