Re: How to migrate a Debian system to another hard drive?
Watch out so you don't run into an infinite loop: Suppose that you mount the target disk on /mnt, then cd / tar cf - . | (cd /mnt; tar xvlpf -) would copy some things to /mnt then copy /mnt/* to /mnt/mnt/ and so on. It doesn't. I've been using this a lot lately while reorganising file systems, and have never had a problem. hamish
Re: How to migrate a Debian system to another hard drive?
Nono no no... please don't rely on such features of GNU software. This will NOT work with a generic cp on other systems. Please use either a piped tar or a cpio,afio or whatever else. The cp method mentioned above is definitely not the way to solve such general unix administration tasks. I don't agree with the above (if you have a choice). In the Unix-haters guide, they raised some good points, but most of them had be addressed by free software. On my sun, the only thing its software is good for is bootstrapping other packages (I rarely use sun cc -- I don't even know what the sun debugger is called anymore (dbx?) Doing cp -a -x / mnt is the way I prefer to move /. A piped tar method is good for understand how it works academically, but I'd rather not type it in . Any since this is debian-users not unix-questions, GNU cp is one of the bests ways, but not portable. -- marty [EMAIL PROTECTED] Member of the League for Programming Freedom
Re: How to migrate a Debian system to another hard drive?
and note that unlike tar, cp -a will actually *handle* pathnames over 100 characters (of course, dpkg won't have installed any, but they may be around for other reasons...) I used the tar approach for years, but cp -a turns out to be much more reliable (and I can fall back to tar if I have to -- knowing that I have to keep an eye on it as well and diff the trees later...)
Re: How to migrate a Debian system to another hard drive?
From: Mark Eichin [EMAIL PROTECTED] and note that unlike tar, cp -a will actually *handle* pathnames over 100 characters Well, we've beaten this dead horse for long enough. I think GNU tar will handle over-100-character filenames. There is an extension to the tar format to handle them. However, my tar-in-a-function that I wrote for dpkg does not have that extension, which is why dpkg won't handle it. Thanks Bruce
Re: How to migrate a Debian system to another hard drive?
Mark Eichin: and note that unlike tar, cp -a will actually *handle* pathnames over 100 characters GNU tar does that as well. -- Please read http://www.iki.fi/liw/mail-to-lasu.html before mailing me. Please don't Cc: me when replying to my message on a mailing list. pgp3uzEpYi8ov.pgp Description: PGP signature
Re: How to migrate a Debian system to another hard drive?
On Tue, 3 Sep 1996, Tim Egbert wrote: On our Debian system, we have two hard drives. The primary drive has the root directory and swap partition and is bootable. It also contains the various Debian software packages, programs, libraries, etc. The second drive just has the /home directory tree. Our problem is that the primary drive is starting to make some expensive sounding noises and may not last much longer. We would like simply to migrate the entire system to the second hard drive and disconnect the first drive. Is there an easy way to do this without reinstalling the entire system and fixing up all the configuration files? I've used dd() to essentially do the same thing, but only in cases where the system partitions I've copied have been of the same size. I'll describe the situation I've used: /dev/hd*1 is a 32-meg swap partition /dev/hd*2 is a 815-meg ext2 partition /dev/hd*3 is a 70?-meg partition for NT (currently unused) With the active partition being /dev/hda, I'll attach the target drive as /dev/hdc, bring the system up, and execute 'dd if=/dev/hda2 of=/dev/hdc2' to do the copy. Because the source partition is active when the duplication is done, you'll need to fisk the target partition, a la 'e2fsck /dev/hdc2' afterward. I've shut the machine down, put /dev/hdc back into its own machine as /dev/hda, bring it back up, and modify /etc/hostname, /etc/init.d/network, and a number of other files to give the target machine its own identity. (Presumably, you won't have to change any files in this manner.) I don't know what would happen if the source and target partitions aren't of the same size. Some pretty nasty things are probably possible, but all of my partitions were identical. David [EMAIL PROTECTED] Office: 3503 WeH, x86720 MTFBWY
Re: How to migrate a Debian system to another hard drive?
Is there a simple way to migrate a Debian system to another hard drive? On our Debian system, we have two hard drives. The primary drive has the root directory and swap partition and is bootable. It also contains the various Debian software packages, programs, libraries, etc. The second drive just has the /home directory tree. Our problem is that the primary drive is starting to make some expensive sounding noises and may not last much longer. We would like simply to migrate the entire system to the second hard drive and disconnect the first drive. Is there an easy way to do this without reinstalling the entire system and fixing up all the configuration files? My suggestion, since you already have the 2 drives on the machine, is to use cp -a -x to copy all of / over to the other drive. Of course, the second drive will be mounted somewhere, like /mnt. I believe that the -x option will make cp ignore the second hard drive, and just copy the root partition over. The -a will make it handle all the symlinks and special files properly. I've done similar things with cp -a -x, and it always worked fine. Of course, once you get it copies over, you'll need to make sure that lilo is installed on the MBR (or whatever) of the second drive so you can boot from it. -- #!/bin/perl -sp0777iX+d*lMLa^*lN%0]dsXx++lMlN/dsM0j]dsj # RSA-3-lines-perl $/=unpack('H*',$_);$_=`echo 16dio\U$kSK$/SM$n\EsN0p[lN*1 # Joey Hess lK[d2%Sa2/d0$^Ixp|dc`;s/\W//g;$_=pack('H*',/((..)*)$/) # [EMAIL PROTECTED] true - do nothing, successfully - - true (1)
RE: How to migrate a Debian system to another hard drive?
On 11:20:51 Tim Egbert wrote: Is there a simple way to migrate a Debian system to another hard drive? On our Debian system, we have two hard drives. The primary drive has the root directory and swap partition and is bootable. It also contains the various Debian software packages, programs, libraries, etc. The second drive just has the /home directory tree. Tim, This question of replicating a filesystem is one that comes up often. I use cpio to do this, and so far its been flawless for me. It creates an exact duplicate of a filesystem, and the following command preserves file access times, symlinks, etc. Works nice, and its simple. Just cd to the root of the filesystem you wish to duplicate, and issues the following command: # find . -depth | cpio -pdmv /target_directory This is based on cpio's pass thru mode. Everything appearing on stdin goes to stdout Paul
RE: How to migrate a Debian system to another hard drive?
When replicating a system between two partitions, the thing most often missed is that you must preserve symbolic links instead of copying them as files. It's also important to preserve the ownership and permissions of files, and obscure things like the setuid bits, character and block special files, and named pipes. I generally use this: cd /old_partition tar cf - . | (cd /new_partition; tar xvlpf -) Note the p flag to the extracting tar. You must be su-ed to root while doing this. See how each side of the pipe has a different current directory? Thanks Bruce
RE: How to migrate a Debian system to another hard drive?
On Tue, 3 Sep 1996, Bruce Perens wrote: |When replicating a system between two partitions, the thing most often |missed is that you must preserve symbolic links instead of copying them |as files. It's also important to preserve the ownership and permissions |of files, and obscure things like the setuid bits, character and block |special files, and named pipes. | |I generally use this: | | cd /old_partition | tar cf - . | (cd /new_partition; tar xvlpf -) | |Note the p flag to the extracting tar. You must be su-ed to root |while doing this. See how each side of the pipe has a different |current directory? | | Thanks | | Bruce u can also do it with `cp` - i did that (even moved my /dev) for any other info plz refer to `man cp` [ I don't remmeber! :-) ] just saying it's possible :-) Regards borik ___ Boris Beletsky [EMAIL PROTECTED] (finger [EMAIL PROTECTED] for pgp public key) ___ Commorandi natura deversorium nobis, non habitandi dedit
RE: How to migrate a Debian system to another hard drive?
On Wed, 4 Sep 1996, borik the Boris Yati Beletsky wrote: u can also do it with `cp` - i did that (even moved my /dev) cp -a is the easiest way to duplicate something. -a, --archive Preserve as much as possible of the structure and attributes of the original files in the copy. The same as -dpR. Guy
RE: How to migrate a Debian system to another hard drive?
On Wed, 4 Sep 1996, Guy Maor wrote: Hello Guy, u can also do it with `cp` - i did that (even moved my /dev) cp -a is the easiest way to duplicate something. -a, --archive Preserve as much as possible of the structure and attributes of the original files in the copy. The same as -dpR. Nono no no... please don't rely on such features of GNU software. This will NOT work with a generic cp on other systems. Please use either a piped tar or a cpio,afio or whatever else. The cp method mentioned above is definitely not the way to solve such general unix administration tasks. su cd / find -not -regex ^\./desireddir/.* -not -regex ^\./mnt/.* | afio -p /mnt or with the more widely used cpio 'find . -depth | cpio -pdmv /target_directory' where target_directory is your mounted new partition. This procedure even works over network connection WITHOUT the use of NFS if your'e using rsh and named pipes. Thus the usage of tapedrives on another machine is possible. Greetings, Steffen - PGP Key fingerprint = 65 18 4E 37 BA F7 4D 67 39 F2 DE F7 99 37 BA 00 PGP Key is available under : http://www.xlink.net/~steffen/steffen.asc - Steffen R.Mueller __ ___ _ _ email: [EMAIL PROTECTED] NTG Netzwerk und Telematic GmbH \ \/ / (_)_ __ | | __ fax : +49 721 9652 210 Geschaeftsbereich Xlink \ /| | | '_ \| |/ / phone: +49 721 9652 211 Vincenz-Priessnitz-Str. 3/ \| | | | | | RIPE : SM25-RIPE D-76131 Karlsruhe, Germany /_/\_\_|_|_| |_|_|\_\ WWW.Xlink.net/~steffen INTERNET. MIT SICHERHEIT
Re: How to migrate a Debian system to another hard drive?
Bruce Perens wrote: [Klippa, klapp, kluppit] cd /old_partition tar cf - . | (cd /new_partition; tar xvlpf -) Watch out so you don't run into an infinite loop: Suppose that you mount the target disk on /mnt, then cd / tar cf - . | (cd /mnt; tar xvlpf -) would copy some things to /mnt then copy /mnt/* to /mnt/mnt/ and so on. Recursive, MartinS
Re: how to migrate a Debian system to another hard drive?
I'm surprised this important question has run for so long. Is it in a Linux FAQ? Anyhow, here's my contribution ( hopefully this'll wrap it up ;- ): cd /; find . -path ./mnt -prune -o print | cpio -pdxm /mnt This copies the whole disk to the mount point /mnt, avoiding the recursive traversal and preserving device files, links and modification times. Casper Boden-Cummins.
RE: How to migrate a Debian system to another hard drive?
On Wed, 4 Sep 1996, Steffen Mueller wrote: |Date: Wed, 4 Sep 1996 11:35:25 +0200 (MET DST) |From: Steffen Mueller [EMAIL PROTECTED] |To: Guy Maor [EMAIL PROTECTED] |Cc: Debian User List debian-user@lists.debian.org |Subject: RE: How to migrate a Debian system to another hard drive? | |On Wed, 4 Sep 1996, Guy Maor wrote: | |Hello Guy, | | u can also do it with `cp` - i did that (even moved my /dev) | | cp -a is the easiest way to duplicate something. | | |-a, --archive | Preserve as much as possible of the structure and | attributes of the original files in the copy. The | same as -dpR. | | | |Nono no no... please don't rely on such features of GNU software. This |will NOT work with a generic cp on other systems. Please use either a |piped tar or a cpio,afio or whatever else. The cp method mentioned above |is definitely not the way to solve such general unix administration tasks. | |su |cd / |find -not -regex ^\./desireddir/.* -not -regex ^\./mnt/.* | afio -p |/mnt | |or with the more widely used cpio | |'find . -depth | cpio -pdmv /target_directory' | |where target_directory is your mounted new partition. | |This procedure even works over network connection WITHOUT the use of NFS |if your'e using rsh and named pipes. Thus the usage of tapedrives on |another machine is possible. | i am telling ya - i moved all my root dir exept /usr from one part to another... it worked i didn't do it with cp -a there are alot more options that i used , i just don't remmeber them now , if u realy want - i can do `man cp` and find out Regards borik -- Boris Beletsky [EMAIL PROTECTED]
RE: How to migrate a Debian system to another hard drive?
On Wed, 4 Sep 1996, borik the Boris Yati Beletsky wrote: Hello Boris, i am telling ya - i moved all my root dir exept /usr from one part to another... it worked i didn't do it with cp -a there are alot more options that i used , i just don't remmeber them now , if u realy want - i can do `man cp` and find out Sure on a Linux system that might work. But try that on say a SCO Openserver. No change. I'm also a system administrator and have to deal with serveral unix falvours... I LOVE my Linux box... but I have to be aware that many features I have there aren't available on other systems NOT GNU equiped. Greetings, Steffen - PGP Key fingerprint = 65 18 4E 37 BA F7 4D 67 39 F2 DE F7 99 37 BA 00 PGP Key is available under : http://www.xlink.net/~steffen/steffen.asc - Steffen R.Mueller __ ___ _ _ email: [EMAIL PROTECTED] NTG Netzwerk und Telematic GmbH \ \/ / (_)_ __ | | __ fax : +49 721 9652 210 Geschaeftsbereich Xlink \ /| | | '_ \| |/ / phone: +49 721 9652 211 Vincenz-Priessnitz-Str. 3/ \| | | | | | RIPE : SM25-RIPE D-76131 Karlsruhe, Germany /_/\_\_|_|_| |_|_|\_\ WWW.Xlink.net/~steffen INTERNET. MIT SICHERHEIT
RE: How to migrate a Debian system to another hard drive?
On Wed, 4 Sep 1996, Steffen Mueller wrote: |Date: Wed, 4 Sep 1996 14:36:44 +0200 (MET DST) |From: Steffen Mueller [EMAIL PROTECTED] |To: borik the Boris Yati Beletsky [EMAIL PROTECTED] |Cc: Guy Maor [EMAIL PROTECTED], |Debian User List debian-user@lists.debian.org |Subject: RE: How to migrate a Debian system to another hard drive? | |On Wed, 4 Sep 1996, borik the Boris Yati Beletsky wrote: | |Hello Boris, | | i am telling ya - i moved all my root dir exept /usr from one part to | another... | it worked | i didn't do it with cp -a | there are alot more options that i used , i just don't remmeber them now , | if u realy want - i can do `man cp` and find out | |Sure on a Linux system that might work. But try that on say a SCO |Openserver. No change. I'm also a system administrator and have to deal |with serveral unix falvours... I LOVE my Linux box... but I have to be |aware that many features I have there aren't available on other systems |NOT GNU equiped. | |Greetings, | |Steffen sure ofcourse but the q was about Linux (i am also LOVE Linux) so... if u can use Linux(GNU) resourses - why not ? :-) p.s. am also a sysadmin - starting one :-) (on linux for now - but warked on sparcs and co.) Regards borik __ Boris Beletsky [EMAIL PROTECTED] (finger [EMAIL PROTECTED] for pgp public key)
RE: How to migrate a Debian system to another hard drive?
On Wed, 4 Sep 1996, borik the Boris Yati Beletsky wrote: |Date: Wed, 4 Sep 1996 15:50:58 +0300 (IDT) |From: borik the Boris Yati Beletsky [EMAIL PROTECTED] |To: Steffen Mueller [EMAIL PROTECTED] |Cc: Guy Maor [EMAIL PROTECTED], |Debian User List debian-user@lists.debian.org |Subject: RE: How to migrate a Debian system to another hard drive? | |On Wed, 4 Sep 1996, Steffen Mueller wrote: | ||Date: Wed, 4 Sep 1996 14:36:44 +0200 (MET DST) ||From: Steffen Mueller [EMAIL PROTECTED] ||To: borik the Boris Yati Beletsky [EMAIL PROTECTED] ||Cc: Guy Maor [EMAIL PROTECTED], ||Debian User List debian-user@lists.debian.org ||Subject: RE: How to migrate a Debian system to another hard drive? || ||On Wed, 4 Sep 1996, borik the Boris Yati Beletsky wrote: || ||Hello Boris, || || i am telling ya - i moved all my root dir exept /usr from one part to || another... || it worked || i didn't do it with cp -a || there are alot more options that i used , i just don't remmeber them now , || if u realy want - i can do `man cp` and find out || ||Sure on a Linux system that might work. But try that on say a SCO ||Openserver. No change. I'm also a system administrator and have to deal ||with serveral unix falvours... I LOVE my Linux box... but I have to be ||aware that many features I have there aren't available on other systems ||NOT GNU equiped. || ||Greetings, || ||Steffen uhh ppl. u all got me wrong i don't trying to argue about this `cp` thing, just worked for me - and because of that i am telling this i just said that as an option - maybe not good one :-) sorry :-) *bow* Reagrds borik __ Boris Beletsky [EMAIL PROTECTED] (finger [EMAIL PROTECTED] for pgp public key)
How to migrate a Debian system to another hard drive?
Is there a simple way to migrate a Debian system to another hard drive? On our Debian system, we have two hard drives. The primary drive has the root directory and swap partition and is bootable. It also contains the various Debian software packages, programs, libraries, etc. The second drive just has the /home directory tree. Our problem is that the primary drive is starting to make some expensive sounding noises and may not last much longer. We would like simply to migrate the entire system to the second hard drive and disconnect the first drive. Is there an easy way to do this without reinstalling the entire system and fixing up all the configuration files? Thanks, // Tim Egbert // Bioengineering Lab, Anesthesiology Department // University of Utah Health Sciences Center
Re: How to migrate a Debian system to another hard drive?
At 07:20 AM 9/3/96 -0600, you wrote: Is there a simple way to migrate a Debian system to another hard drive? On our Debian system, we have two hard drives. The primary drive has the root directory and swap partition and is bootable. It also contains the various Debian software packages, programs, libraries, etc. The second drive just has the /home directory tree. Our problem is that the primary drive is starting to make some expensive sounding noises and may not last much longer. We would like simply to migrate the entire system to the second hard drive and disconnect the first drive. Is there an easy way to do this without reinstalling the entire system and fixing up all the configuration files? Thanks, // Tim Egbert // Bioengineering Lab, Anesthesiology Department // University of Utah Health Sciences Center I have done this under other flavors of UNIX by doing a full dump to tape, then doing a fresh install of just a base system, then doing a full restore from tape. As I recall, some of the symbolic links didn't come back right and I had to tweak them manually, but I got the systems up and running without too much pain. I am interested to hear others' opinions about this. --- Key fingerprint = D6 A7 D7 8C 92 CB 42 FD 60 D5 62 1C D7 B9 EA 8E Ken Gaugler N6OSK Hybrid Networks, Inc. Cupertino, Calif. URL: www.hybrid.com (home: [EMAIL PROTECTED] URL: users.aimnet.com/~keng) The life of a Repo Man is ALWAYS INTENSE...