[opensuse] hard drive replacement question
Hello SuSE people, Seems I have an ancient 8GB hard drive which is failing. At least smart seems to think so. New hard drive on it's way. All properly backed up to my external "back up" drive with rsync. I know this has been discussed a million times on this list but old stupid never paid much attention.So now that I am faced with this realiity of life and computers, how do I proceed? Put in the new hard drive replacement, then what? Must be formatted, OK that's a no-brainer. Must I partition it to match the old drive for rsync? (home,var, usr) are all separate partitions. (same size? larger?) Will rsync sort it all out? Is there a how-to / wiki page somewhere that can give some guidance? Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sat, 25 Apr 2009 00:27:11 -0400, Bob S wrote:
Hello SuSE people,
Seems I have an ancient 8GB hard drive which is failing. At least smart seems to think so. New hard drive on it's way. All properly backed up to my external "back up" drive with rsync.
As it happens, I have an old system that's in the throes of dying today (hard locks about 10 times during the day), so I've been going through a similar process.
Must I partition it to match the old drive for rsync?
rsync doesn't care about partition sizes. As long as there's enough space to hold the data, it's fine. rsync doesn't know anything about drive geometries - it's file-centric.
(home,var, usr) are all separate partitions. (same size? larger?) Will rsync sort it all out? Is there a how-to / wiki page somewhere that can give some guidance?
rsync will not recreate partitions for you. It doesn't operate at that level. That also means, however, that if the drive that's failing is bootable, the replacement drive won't be when you restore. Is this the primary drive in a system, or is it just a data drive? Jim -- Jim Henderson Please keep on-topic replies on the list so everyone benefits -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Bob S wrote:
Hello SuSE people,
Seems I have an ancient 8GB hard drive which is failing. At least smart seems to think so. New hard drive on it's way. All properly backed up to my external "back up" drive with rsync.
I know this has been discussed a million times on this list but old stupid never paid much attention.So now that I am faced with this realiity of life and computers, how do I proceed?
Put in the new hard drive replacement, then what? Must be formatted, OK that's a no-brainer. Must I partition it to match the old drive for rsync? (home,var, usr) are all separate partitions. (same size? larger?) Will rsync sort it all out? Is there a how-to / wiki page somewhere that can give some guidance?
Bob S
Bob, Forget rsync, 'dd' is your friend here. The replacement can be as simple as hooking your new drive up and doing "dd old new", remove old, reboot, done! We'll call the new drive /dev/sdb for this example and /dev/sda the old, then just hook your new driver up, then: dd if=/dev/sda of=/dev/sdb Let it finish, remove old drive, and reboot. Can't get much simpler. For your further reading pleasure (and more detail), see: http://www.rajeevnet.com/hacks_hints/os_clone/os_cloning.html -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
David C. Rankin wrote:
Forget rsync, 'dd' is your friend here. The replacement can be as simple as hooking your new drive up and doing "dd old new", remove old, reboot, done! We'll call the new drive /dev/sdb for this example and /dev/sda the old, then just hook your new driver up, then:
dd if=/dev/sda of=/dev/sdb
David, that way Bob will end up with an exact copy of his old 8Gb drive, which is (probably) good/useful, but he'll also have no use for the remaining gigabytes - the new drive is likely to be 160G or bigger. I think the process is more likely to be like this: Remove old harddive, install new harddrive, create partition(s) and filesystem(s), mount desired filesystem in desired place, rsync back content from external backup. If the old drive was the boot drive, rerun grub or lilo. /Per -- Per Jessen, Zürich (24.0°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
For cloning my system hard drive I've always used "cp -a /tree_old /mnt/." I've always done as root. Under /mnt is/are the new hard drive partition/s. Then at the root level perform the cp -a commands on all trees except /proc. I will always double check /mnt/etc/fstab as well as /mnt/boot/grub/menu.lst and change partition entries as required. Just another way of doing the job. Regards, Terry -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Terry Eck wrote:
For cloning my system hard drive I've always used "cp -a /tree_old /mnt/." I've always done as root. Under /mnt is/are the new hard drive partition/s.
Yeah, cp is just as good - the main advantage in rsync is that is restartable. /Per -- Per Jessen, Zürich (23.4°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2009-04-25 at 18:24 +0200, Per Jessen wrote:
For cloning my system hard drive I've always used "cp -a /tree_old /mnt/." I've always done as root. Under /mnt is/are the new hard drive partition/s.
Yeah, cp is just as good - the main advantage in rsync is that is restartable.
Exactly. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAknzZjAACgkQtTMYHG2NR9XN1gCgjX9T+AvL9+Y/Iky4O24CLc4O fJQAni/67lwnfAao6IV7xtrbv2RuFsO/ =3wSl -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
David C. Rankin wrote:
Forget rsync, 'dd' is your friend here. The replacement can be as simple as hooking your new drive up and doing "dd old new", remove old, reboot, done! We'll call the new drive /dev/sdb for this example and /dev/sda the old, then just hook your new driver up, then:
dd if=/dev/sda of=/dev/sdb
David, that way Bob will end up with an exact copy of his old 8Gb drive, which is (probably) good/useful, but he'll also have no use for the remaining gigabytes - the new drive is likely to be 160G or bigger.
I thought partitions could be enlarged. So, set up as an 8GB and then go from there. -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2009-04-25 at 19:04 -0400, James Knott wrote:
David, that way Bob will end up with an exact copy of his old 8Gb drive, which is (probably) good/useful, but he'll also have no use for the remaining gigabytes - the new drive is likely to be 160G or bigger.
I thought partitions could be enlarged. So, set up as an 8GB and then go from there.
No, partitions can not be enlarged, unless there is free space directly after that partition, or you are using LVM. If you clone a HD as is, you get a new disk with the same contiguous partitions as in the original. You can add new partitions, or you can use a tool like Partition Magic to enlarge them (and that tool moves sectors out of the way to get it done, a procedure that takes many long hours). That procedure is full of problems in the road. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAknzmjIACgkQtTMYHG2NR9UKGQCfYbpPZSxllPnDCjHyR1zIuK6z eMEAniJdKzB1uPzaOcEUtfL7M0UiYuu0 =G4jA -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On 04/26/2009 07:17 AM, Carlos E. R. wrote:
On Saturday, 2009-04-25 at 19:04 -0400, James Knott wrote:
David, that way Bob will end up with an exact copy of his old 8Gb drive, which is (probably) good/useful, but he'll also have no use for the remaining gigabytes - the new drive is likely to be 160G or bigger.
I thought partitions could be enlarged. So, set up as an 8GB and then go from there.
No, partitions can not be enlarged, unless there is free space directly after that partition, or you are using LVM. If you clone a HD as is, you get a new disk with the same contiguous partitions as in the original. You can add new partitions, or you can use a tool like Partition Magic to enlarge them (and that tool moves sectors out of the way to get it done, a procedure that takes many long hours).
That procedure is full of problems in the road.
Actually gparted does the job quite well and quickly. I have even moved partitions to make a lower partition bigger. IMO, gparted has become one of the best partitioning tools. -- Joe Morris Registered Linux user 231871 running openSUSE 11.1 x86_64 -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2009-04-26 at 07:57 +0800, Joe Morris wrote:
I thought partitions could be enlarged. So, set up as an 8GB and then go from there.
No, partitions can not be enlarged, unless there is free space directly after that partition, or you are using LVM. If you clone a HD as is, you get a new disk with the same contiguous partitions as in the original. You can add new partitions, or you can use a tool like Partition Magic to enlarge them (and that tool moves sectors out of the way to get it done, a procedure that takes many long hours).
That procedure is full of problems in the road. Actually gparted does the job quite well and quickly. I have even moved partitions to make a lower partition bigger. IMO, gparted has become one of the best partitioning tools.
Well, that's interesting. But frankly, copying files directly to a new (or same) partition layout would be faster and easier. I don't see any gain, except to experiment. Just create new partitions, mount a new filesystem hierarchy, change sizes, order, number of partitions, anything - or nothing! Then, copy all the files from old to new structure. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAknzrXkACgkQtTMYHG2NR9XyJQCfXuY0GCCDS3oPWWVab6Daq+Gu if8AniHtO7tUT8rHzu4FzsQJa1x5t7Cp =gGsr -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 26 Apr 2009 02:40:24 +0200, Carlos E. R. wrote:
Actually gparted does the job quite well and quickly. I have even moved partitions to make a lower partition bigger. IMO, gparted has become one of the best partitioning tools.
Well, that's interesting. But frankly, copying files directly to a new (or same) partition layout would be faster and easier. I don't see any gain, except to experiment.
Depending on how you do things, you can create problems by copying files that you shouldn't - like device files, the /proc partition, etc. I would personally be inclined to either clone the device and then expand the partitions (after all, the original drive is available still so if something gets messed up you'll know very quickly and can take another run at it) and you'll get exactly what you had to start with. Symlinks won't get broken and other such issues won't work. If I wasn't going to use dd to clone (or was going from a larger to smaller drive for some reason), I'd go to rsync rather than cp. Though the -a option preserves timestamps, ownership, etc, so it's probably a wash unless you're pulling from a remote system. Jim -- Jim Henderson Please keep on-topic replies on the list so everyone benefits -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Carlos E. R. wrote:
That procedure is full of problems in the road. Actually gparted does the job quite well and quickly. I have even moved partitions to make a lower partition bigger. IMO, gparted has become one of the best partitioning tools.
Well, that's interesting. But frankly, copying files directly to a new (or same) partition layout would be faster and easier. I don't see any gain, except to experiment.
I guess you've never done any disk imaging. That's common in the corporate world, where you create a standard image for users. The image is copied from a server to a hard drive and then resized to fit the disk. In past lives, I've used both Ghost and Partition Magic to do that. -- Use OpenOffice.org http://www.openoffice.org -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2009-04-25 at 20:55 -0400, James Knott wrote:
Carlos E. R. wrote:
That procedure is full of problems in the road. Actually gparted does the job quite well and quickly. I have even moved partitions to make a lower partition bigger. IMO, gparted has become one of the best partitioning tools.
Well, that's interesting. But frankly, copying files directly to a new (or same) partition layout would be faster and easier. I don't see any gain, except to experiment.
I guess you've never done any disk imaging. That's common in the corporate world, where you create a standard image for users. The image is copied from a server to a hard drive and then resized to fit the disk. In past lives, I've used both Ghost and Partition Magic to do that.
Me too. But, as there was not Ghost and PM in the Linux world, I've changed my methods. Well, there is a ghost for Linux now, but I find it cumbersome compared to the commercial program. Anyway, those commercial tools don't do a "dd" type of copy and then resize. The new copy is created on the fly with the new properties if the program understands (ie, supports) the format. PM can be very slow when moving partitions on the same HD. So, nowdays I do my "imaging" in Linux via rsync instead. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkn0ObkACgkQtTMYHG2NR9XRfACdGInOgpeBNY6CQCJ5hHEfDc/8 QOQAoIZTuGwayy9GIPTRNZQuzYPCRVNn =d97e -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
James Knott wrote:
Per Jessen wrote:
David C. Rankin wrote:
Forget rsync, 'dd' is your friend here. The replacement can be as simple as hooking your new drive up and doing "dd old new", remove old, reboot, done! We'll call the new drive /dev/sdb for this example and /dev/sda the old, then just hook your new driver up, then:
dd if=/dev/sda of=/dev/sdb
David, that way Bob will end up with an exact copy of his old 8Gb drive, which is (probably) good/useful, but he'll also have no use for the remaining gigabytes - the new drive is likely to be 160G or bigger.
I thought partitions could be enlarged. So, set up as an 8GB and then go from there.
Yes, The main purpose of suggesting dd, was that Bob will also get the master boot record copied. That way he never even has to worry about sticking an install disk in the cd drive;-) As for the disk size thing, let's say Bob's 8G drive is partitioned as: /dev/sda1 100M mounted as /boot /dev/sda5 3G mounted as / /dev/sda6 4G mounted as /home /dev/sda7 900M swap Let's say new drive is 500G. After dd, then Bob can just create additional partitions out of the unused space. If / is tight because /var is getting close to full, then just cfdisk create a new 10G extended partition /dev/sda8, mount /dev/sda8 /mnt/tmp; cp -a /var/* /mnt/tmp; umount /mnt/tmp; rm -r /var; mount /dev/sda8 /var. If bob was going to upgrade to 11 or 11.1, then of course I'd just unplug the current hard drive, install the new, install openSuSE, the plug the old hard drive back in as a slave and then rsync -a or cp -a all the data from /old /new -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
Per Jessen wrote:
David C. Rankin wrote:
Forget rsync, 'dd' is your friend here. The replacement can be as simple as hooking your new drive up and doing "dd old new", remove old, reboot, done! We'll call the new drive /dev/sdb for this example and /dev/sda the old, then just hook your new driver up, then:
dd if=/dev/sda of=/dev/sdb
David, that way Bob will end up with an exact copy of his old 8Gb drive, which is (probably) good/useful, but he'll also have no use for the remaining gigabytes - the new drive is likely to be 160G or bigger.
I think the process is more likely to be like this:
Remove old harddive, install new harddrive, create partition(s) and filesystem(s), mount desired filesystem in desired place, rsync back content from external backup. If the old drive was the boot drive, rerun grub or lilo.
/Per
Agreed, that's why I provided the link. No idea how big new drive is, but the link covered all considerations very well. -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Saturday, 2009-04-25 at 00:27 -0400, Bob S wrote:
Put in the new hard drive replacement, then what? Must be formatted, OK that's a no-brainer. Must I partition it to match the old drive for rsync?
Not really. Partition it as you like.
(home,var, usr) are all separate partitions. (same size? larger?)
Whatever you need :-)
Will rsync sort it all out?
No, you sort it out and tell rsync what to do :-P Rsync just copies files from one place to another; it doesn't matter if one side is one partition and the other is twenty. Just make sure they are properly mounted and there is enough available space.
Is there a how-to / wiki page somewhere that can give some guidance?
Of course. An old one: Hard Disk Upgrade Mini How-To /usr/share/doc/howto/en/txt/Hard-Disk-Upgrade.gz if you have it installed. Or google it. - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAknzBNMACgkQtTMYHG2NR9WVRwCcDc4oMAZIb12K4aVOXlfqp7e6 V1cAn12faEAaW1qvrStn43qDwVT5/MmJ =kq2A -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Saturday 25 April 2009 12:27:11 am Bob S wrote:
Hello SuSE people,
Seems I have an ancient 8GB hard drive which is failing. At least smart seems to think so. New hard drive on it's way. All properly backed up to my external "back up" drive with rsync.
Wow ! what a response. Hate replying to my own posts but there were so many replies I didn't know who to reply to. Anyway, here is more info to avoid further speculation. I have 3 internal drives (two IDE and one SATA) and run 4 different OS's The failing 8GB drive (sdb) has only one OS on it. My SuSE 11.1 testbed. I have 4 partions on it. ( /, /home, /tmp, /var) and it fills the drive. I had to use the rescue function on the DVD to disable the /home and /tmp partitions to keep my computer running for the other OS's My menu.lst is on the 11.1 /root/grub. (very worrisome, the failing drive) As stated previously it is backed up with rsync. Partitions are mounted by label and I do not use LVM. The new drive is 160GB. (arriving soon I hope) I want to duplicate the 11.1 testbed on to the new drive and use all of the remaining space for other uses. I could as suggested, disconnect my sda and plug in the new drive there and do a dd as David suggested. But, would dd copy over the "corruption"? If so, could I then rsync and replace the "corrupted" portions and then use gparted to create more partitions after everything was copied over and working correctly? Then again if I swap out the drive and do the gparted partition method, I will have to figure out how to tell rsync where to put what. Thanks guys for all the suggestions and info. Any other comments would be welcome. I'll let you know what I did and how it turned out when the new drive arrives. Bob S -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
On Sun, 26 Apr 2009 00:55:35 -0400, Bob S wrote:
I could as suggested, disconnect my sda and plug in the new drive there and do a dd as David suggested. But, would dd copy over the "corruption"? If so, could I then rsync and replace the "corrupted" portions and then use gparted to create more partitions after everything was copied over and working correctly?
dd would give you a sector-by-sector duplicate of the original drive. So if there are corrupted files, then yes, it would copy the corruption. But if there are corrupted files, rsync or cp won't fix that either. You might be better off pulling what data you can from the drive (not OS stuff) and then doing a fresh reinstall of 11.1 on the new drive. Or vice-versa, do a fresh install on the new drive, plug the old drive in and then copy the data you want to preserve from the dying drive. Jim -- Jim Henderson Please keep on-topic replies on the list so everyone benefits -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sunday, 2009-04-26 at 00:55 -0400, Bob S wrote:
I have 3 internal drives (two IDE and one SATA) and run 4 different OS's The failing 8GB drive (sdb) has only one OS on it. My SuSE 11.1 testbed. I have 4 partions on it. ( /, /home, /tmp, /var) and it fills the drive.
For such a small one I would have used a single partition. My tests systems (factory, for example) are set that way. Only /boot is separate if needed. It saves space.
I had to use the rescue function on the DVD to disable the /home and /tmp partitions to keep my computer running for the other OS's My menu.lst is on the 11.1 /root/grub. (very worrisome, the failing drive) As stated previously it is backed up with rsync. Partitions are mounted by label and I do not use LVM.
The new drive is 160GB. (arriving soon I hope) I want to duplicate the 11.1 testbed on to the new drive and use all of the remaining space for other uses.
I could as suggested, disconnect my sda and plug in the new drive there and do a dd as David suggested. But, would dd copy over the "corruption"? If so, could I then rsync and replace the "corrupted" portions and then use gparted to create more partitions after everything was copied over and working correctly?
If you do not have free HD slots, you could use a USB HD box. Yes, dd would copy the corruption, of course. Yes, you could use rsync and the bad parts from backup instead - assuming that rsync does not abort. I'm not sure what it will do. A note. Suppose you have a source tree: / /var /tmp /home And you want to copy it to a destination new drive, with rsync. The new one has a different structure (for argument shake): /new/ /new/usr /new/home /new/tmp /new/data It does not matter. Just rsync from source to new destination (/new)... the only problem is how to state the source not to include /new and end being recursive. It is easier if old disk is mounted like: /old/ /old/var /old/tmp /old/home Then, "rsync {options} /old /new" would work (I forget if a "/" is needed at the end or not. I never remember that "detail" and have to test it). Ah! Another handy tool to do the copy, is mc, midnight commander. It will work just as well (except if aborted, rsync is restartable). - -- Cheers, Carlos E. R. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) iEYEARECAAYFAkn0OAIACgkQtTMYHG2NR9XkqwCfaDDWBTPrif29ENzrqGZZALqv 63AAoIAg1kmut7fpdjKoQ2CsKNgBjowE =QA3g -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org
participants (8)
-
Bob S
-
Carlos E. R.
-
David C. Rankin
-
James Knott
-
Jim Henderson
-
Joe Morris
-
Per Jessen
-
Terry Eck