Re: Upgrading Hard Drives
On Sat, Aug 16, 2008 at 12:15:41AM +0300, Andrei Popescu wrote: On Sat,16.Aug.08, 07:07:39, Alex Samad wrote: man rsync -x, --one-file-system don’t cross filesystem boundaries which means not to traverse any filesystem mounts, which is why it doesn't do /prox /sys /dev, they are all mounted filesystems (it will create the mount point though. I didn't know it will create the mountpoints also, that was the missing bit I wanted to fill. yep your right, I am wrong, early morning emailing :). the mount points are not created a Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) -- If I become president, we're going to have emergency-room care, we're going to have gag orders. - George W. Bush 10/18/2000 St. Louis, MO during the third presidential debate signature.asc Description: Digital signature
Re: Upgrading Hard Drives
On Friday 15 August 2008 14:41, Martin McCormick wrote: I've got a working Debian system that I am about to break. I am replacing the master drive with a new one that is 32 times the size of the old one and want to transfer the system intact from the old one to the new one so dd is not an option but I want to be sure to preserve all the special files and the boot sector for the new disk. This is really easy :) The a command in fdisk says to toggle a boot flag. When I make a Linux partition and then mkfs -text3, what state is that flag in? I looked at the known good disk and the new one and fdisk reported the same information except for size. I must admit my ignorance in this matter. I plan to use dar to put the old system on to the new drive. Will that preserve all the special files? If not for those, ordinary tar would work for everything else? The end result should be the same system as before but with a _LOT_ more space. Thanks for any constructive ideas. I'd do this: 1. plug the new one in and reboot and configure the bios 2. boot up debian into single user mode 3. create partition(s) in the new disk drive with cfdisk 4. create filesystems in the new disk drive with mkfs.ext3 5. create the swap space in the new disk drive using mkswap Here's mine (pasted from cfdisk): Name FlagsPart TypeFS Type[Label] Size (MB) - sda1 Boot Primary Linux ext3 57.58 sda5Logical Linux swap / Solaris 2000.0* sda6 NCLogical Linux LVM 72290.7* In this case I use LVM, which is a good idea in a lot of cases. 6. mount the new filesystem(s) in /mnt/newfs, for example 7. run 'rsync -axPh / /mnt/newfs' 8. edit /mnt/newfs/etc/fstab to reflect the changes; I'd use UUID's for the filesystems; you can determine the UUID's of your filesystems with 'blkid' Here's mine: # /etc/fstab: static file system information. # # file system mount point type options dump pass proc /proc proc defaults 0 0 UUID=f94f5a03-67ca-4932-a9d5-2328776c6285 /boot ext3 defaults UUID=8a4fb183-7092-4041-af8f-41158e356df1 / ext3 defaults,errors=remount-ro 0 1 UUID=4833592d-6afa-46c2-8c7c-35b85c7ac4ea none swap sw 0 0 /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,utf8 0 0 # backup HDD UUID=9bcab58b-1c0d-4bd9-888c-dc205117eb2a /mnt/backup_hdd ext3 defaults,noauto 0 0 9. 'shutdown -h now' 10. plug out the old disk drive 11. boot up debian from the new disk drive using the grub boot floppy you're prepared earlier (see the grub-disk package) 12. edit /boot/grub/menu.lst; specifically the #kopt option if it is necessary 13. run grub-install (man grub-install) 14. run update-grub 15. 'shutdown -r now' to see if it all works... I wonder if I missed anything... Have fun! Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group -- Shachar Or | שחר אור http://ox.freeallweb.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
Shachar Or writes: On Friday 15 August 2008 14:41, Martin McCormick wrote: I've got a working Debian system that I am about to break. I am replacing the master drive with a new one that is 32 times the size of the old one and want to transfer the system intact from the old one to the new one so dd is not an option but I want to be sure to preserve all the special files and the boot sector for the new disk. This is really easy :) The a command in fdisk says to toggle a boot flag. When I make a Linux partition and then mkfs -text3, what state is that flag in? I looked at the known good disk and the new one and fdisk reported the same information except for size. I must admit my ignorance in this matter. I plan to use dar to put the old system on to the new drive. Will that preserve all the special files? If not for those, ordinary tar would work for everything else? The end result should be the same system as before but with a _LOT_ more space. Thanks for any constructive ideas. I'd do this: 1. plug the new one in and reboot and configure the bios 2. boot up debian into single user mode 3. create partition(s) in the new disk drive with cfdisk 4. create filesystems in the new disk drive with mkfs.ext3 5. create the swap space in the new disk drive using mkswap I accidentally responded to him directly so this is for the list. While have used fdisk many times, cfdisk is a bit new to me so I should give it a try. Again, thanks. Martin McCormick WB5AGZ Stillwater, OK Systems Engineer OSU Information Technology Department Telecommunications Services Group -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
On Fri,15.Aug.08, 06:41:06, Martin McCormick wrote: [...] The a command in fdisk says to toggle a boot flag. When I make a Linux partition and then mkfs -text3, what state is that flag in? I looked at the known good disk and the new one and fdisk reported the same information except for size. AFAIK grub doesn't care about the boot flag (DOS and Windows 9x used to care about it; you could use it to fake a dual-boot system) I plan to use dar to put the old system on to the new drive. Will that preserve all the special files? I like rsync. If you do it from a live CD it will copy only files actually on disk, not the ones created dynamically by e.g. udev. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) signature.asc Description: Digital signature
Re: Upgrading Hard Drives
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Martin McCormick wrote: I've got a working Debian system that I am about to break. I am replacing the master drive with a new one that is 32 times the size of the old one and want to transfer the system intact from the old one to the new one so dd is not an option but I want to be sure to preserve all the special files and the boot sector for the new disk. It may be overkill, but you could look at the partimage package. Not only can it copy a filesystem, but it can expand it too. You could also use dd and copy each partition separately instead of the entire drive. The tricky part would be the boot sector, but that can be easily rebuilt by booting off a rescue cd, chrooting to the now-moved system and re-running grub-install. Make sure you mount all of the filesystems like /boot, /proc, etc. Regards, Tod Detre - -- Pantek, Inc. - http://www.pantek.com/ - [EMAIL PROTECTED] +1-877-LINUX-FIX - Expert Open Source Technical Support -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkil0QQACgkQBp/fZcDt4JvK4ACgulr0ZCPwQQnVi+jwxKxVVPVM vxQAoJLqKGpGaRb1F7a70jmFkNMPKOrE =QkGb -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
On Friday 15 August 2008 22:27, Andrei Popescu wrote: On Fri,15.Aug.08, 06:41:06, Martin McCormick wrote: [...] The a command in fdisk says to toggle a boot flag. When I make a Linux partition and then mkfs -text3, what state is that flag in? I looked at the known good disk and the new one and fdisk reported the same information except for size. AFAIK grub doesn't care about the boot flag (DOS and Windows 9x used to care about it; you could use it to fake a dual-boot system) I plan to use dar to put the old system on to the new drive. Will that preserve all the special files? I like rsync. If you do it from a live CD it will copy only files actually on disk, not the ones created dynamically by e.g. udev. There's the -x option for this. It isn't specifically for this purpose but it works. Regards, Andrei -- Shachar Or | שחר אור http://ox.freeallweb.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
On Fri,15.Aug.08, 23:05:32, Shachar Or wrote: I like rsync. If you do it from a live CD it will copy only files actually on disk, not the ones created dynamically by e.g. udev. There's the -x option for this. It isn't specifically for this purpose but it works. AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) signature.asc Description: Digital signature
Re: Upgrading Hard Drives
On Friday 15 August 2008 23:15, Andrei Popescu wrote: On Fri,15.Aug.08, 23:05:32, Shachar Or wrote: I like rsync. If you do it from a live CD it will copy only files actually on disk, not the ones created dynamically by e.g. udev. There's the -x option for this. It isn't specifically for this purpose but it works. AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. But wait - doesn't it copy the directories themselves, aka the mount points? Regards, Andrei -- Shachar Or | שחר אור http://ox.freeallweb.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
On Fri,15.Aug.08, 23:42:58, Shachar Or wrote: AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. But wait - doesn't it copy the directories themselves, aka the mount points? Don't you need those as well? # mount /dev/sda2 /no-such-dir mount: mount point /no-such-dir does not exist Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) signature.asc Description: Digital signature
Re: Upgrading Hard Drives
On Fri, Aug 15, 2008 at 11:42:58PM +0300, Shachar Or wrote: On Friday 15 August 2008 23:15, Andrei Popescu wrote: On Fri,15.Aug.08, 23:05:32, Shachar Or wrote: I like rsync. If you do it from a live CD it will copy only files actually on disk, not the ones created dynamically by e.g. udev. There's the -x option for this. It isn't specifically for this purpose but it works. AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. But wait - doesn't it copy the directories themselves, aka the mount points? man rsync -x, --one-file-system don’t cross filesystem boundaries which means not to traverse any filesystem mounts, which is why it doesn't do /prox /sys /dev, they are all mounted filesystems (it will create the mount point though. The other affect is that it will not copy a mounted /home or any other mount filesystem if you start at / Regards, Andrei -- Shachar Or | שחר אור http://ox.freeallweb.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED] -- America better beware of a candidate who is willing to stretch reality in order to win points. - George W. Bush 09/18/2000 aboard his campaign plane signature.asc Description: Digital signature
Re: Upgrading Hard Drives
On Sat,16.Aug.08, 07:07:39, Alex Samad wrote: man rsync -x, --one-file-system don’t cross filesystem boundaries which means not to traverse any filesystem mounts, which is why it doesn't do /prox /sys /dev, they are all mounted filesystems (it will create the mount point though. I didn't know it will create the mountpoints also, that was the missing bit I wanted to fill. Regards, Andrei -- If you can't explain it simply, you don't understand it well enough. (Albert Einstein) signature.asc Description: Digital signature
Re: Upgrading Hard Drives
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. But wait - doesn't it copy the directories themselves, aka the mount points? When copying systems with rsync I tend to use --exclude to prevent /proc, /sys, etc. that way the mount points don't even need to be the same on the target location. For example system a could have everything in one / partition where system b has separate /boot, /usr, etc. if you do the --exclude syntax right it'll even create the base dir and just exclude everything under it. Regards, Tod Detre - -- Pantek, Inc. - http://www.pantek.com/ - [EMAIL PROTECTED] +1-877-LINUX-FIX - Expert Open Source Technical Support -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkil+NwACgkQBp/fZcDt4JvkFQCguqQZa/2L2jUnmTOvs8u+boha NmUAoMN5iAE7DqV7s2Cn5eCu/HOPjvN4 =Nvwt -END PGP SIGNATURE- -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
On Saturday 16 August 2008 00:05, Andrei Popescu wrote: On Fri,15.Aug.08, 23:42:58, Shachar Or wrote: AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. But wait - doesn't it copy the directories themselves, aka the mount points? Don't you need those as well? Yes, those are needed. I didn't mean that they're not needed. I meant that I'm not sure that they get excluded; I think they may get copied with rsync -x. # mount /dev/sda2 /no-such-dir mount: mount point /no-such-dir does not exist Regards, Andrei -- Shachar Or | שחר אור http://ox.freeallweb.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Re: Upgrading Hard Drives
On Saturday 16 August 2008 00:45, Tod Detre wrote: AFAIU -x will prevent rsync from touching /proc, /sys and /dev, but you will need the directories themselves to be present on the new root partition, so I think it is better to omit -x *if* the system you want to clone is *not* running. But wait - doesn't it copy the directories themselves, aka the mount points? When copying systems with rsync I tend to use --exclude to prevent /proc, /sys, etc. that way the mount points don't even need to be the same on the target location. For example system a could have everything in one / partition where system b has separate /boot, /usr, etc. if you do the --exclude syntax right it'll even create the base dir and just exclude everything under it. Going in that direction, one could use the -F option and put an /.rsync-filter instead of the -x option. Regards, Tod Detre -- Pantek, Inc. - http://www.pantek.com/ - [EMAIL PROTECTED] +1-877-LINUX-FIX - Expert Open Source Technical Support -- Shachar Or | שחר אור http://ox.freeallweb.org/ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]