[opensuse] Need some DD foo
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out. Have new drive ready to install in an external USB enclosure. I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake). I can either do this booting from the old drive or I have a bootable DVD Knopix around. Is there any way to DD this drive across and take advantage of the full size of the newer drive? My fallback is, of course a fresh install, and copy of files, but I was hoping to put that off till 13.2. (Its currently a very stable 12.3 and I have no desire to go to 31.1 at the this late date.) Or is this a fools errand? -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 2014-08-18 20:35 (GMT-0700) John Andersen composed:
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out.
Have new drive ready to install in an external USB enclosure.
I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake).
I can either do this booting from the old drive or I have a bootable DVD Knopix around.
Booting Knoppix (anything except disk being copied from) should reduce the steps required considerably.
Is there any way to DD this drive across and take advantage of the full size of the newer drive?
I've more or less been doing this for years, but I use a more convenient (non-free) cloner than dd. Basically it involves creating partitions of the new sizes on the new disk, cloning partition by partition, then using the applicable filesystem resizer, which in my case is normally resize2fs. That needs to be followed up by tidying up (and reinstalling bootloader(s)) and fstabs for anything that needs to be different, such as UUIDs and volume labels.
My fallback is, of course a fresh install, and copy of files, but I was hoping to put that off till 13.2. (Its currently a very stable 12.3 and I have no desire to go to 31.1 at the this late date.)
Or is this a fools errand?
You might rather want to use one of the ddrescues instead of dd if a lot of errors are involved. -- "The wise are known for their understanding, and pleasant words are persuasive." Proverbs 16:21 (New Living Translation) Team OS/2 ** Reg. Linux User #211409 ** a11y rocks! Felix Miata *** http://fm.no-ip.com/ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 08/19/2014 05:35 AM, John Andersen wrote:
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out.
Have new drive ready to install in an external USB enclosure.
I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake).
I can either do this booting from the old drive or I have a bootable DVD Knopix around.
Is there any way to DD this drive across and take advantage of the full size of the newer drive?
As Felix already mentioned, you could create the same partitioning on the new drive and then do the copying per partition. This will save you the time or trouble to copy the swap partition as you can easily run mkswap(8) on the new drive's swap partition. Then, a rescue system like Knoppix is probably better than booting into the old, failing disk's system because that would write onto the old disk and so stress it unnecessarily. Using a such a live system also has the advantage that you can mount the file system(s) on the old drive read-only which is always a good idea in such a case. Regarding the copying itself: the success will depend on how many and how big the bad blocks are on the old drive. And there's another argument: with block-level copying methods like dd and friends you will have zeroed blocks of data on the new file system where reading on the old failed without knowing which files are corrupted. This may be an argument for using plain cp(1) which would give you an error diagnostic per failing file. OTOH, the latter may be slower (which should never be an argument while rescuing). I'll come to such a file-level option later again. Now regarding dd(1): as it would usually exit on the first bad read(), you'll need at least the following options (as mentioned similarly in the Texinfo manual [1], too): # Rescue data from an (unmounted!) partition of a failing disk. dd conv=noerror,sync iflag=fullblock < /dev/sda1 > /dev/sdb1 [1] http://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html Furthermore, you may want to think about the block size parameter: while it would be convenient to use a huge block size like "bs=1G" on healthy drives for better speed, this would mean that if only the reading of one physical block from the old disk fails, then the rest of the whole 1G on the new drive may be filled with Zeroes, ugh. Therefore, I'd leave the quite small default for the block size on the reading side while doing some buffering on the writing side: dd ... obs=32M ... Finally, nothing prevents you from trying to get the names of the corrupted files afterward - by mounting both sides (the old one probably read-only), and issuing something like rsync -n -Haix --delete /mnt/old-partition1/. /mnt/new-partition1/. with (or maybe later without) the dry-run option -n. Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
John Andersen wrote:
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out.
Have new drive ready to install in an external USB enclosure.
I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake).
I can either do this booting from the old drive or I have a bootable DVD Knopix around.
Is there any way to DD this drive across and take advantage of the full size of the newer drive?
My fallback is, of course a fresh install, and copy of files, but I was hoping to put that off till 13.2. (Its currently a very stable 12.3 and I have no desire to go to 31.1 at the this late date.)
Or is this a fools errand?
True using ddrescue instead of dd -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
John Andersen wrote:
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out.
Have new drive ready to install in an external USB enclosure.
I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake).
I can either do this booting from the old drive or I have a bootable DVD Knopix around.
Is there any way to DD this drive across and take advantage of the full size of the newer drive?
My fallback is, of course a fresh install, and copy of files, but I was hoping to put that off till 13.2. (Its currently a very stable 12.3 and I have no desire to go to 31.1 at the this late date.)
Or is this a fools errand?
Personally, I would partition the new drive and then use rsync to copy the filesystems (this has the advantage of defragging not only files but directory structures, too). IF you get too many errors such that rsync quits, then copy over the filesystems that didn't copy with rsync, using ddrescue [see manpage .. it's almost identical to dd, but is error-tolerant -- ddrescue continually reads bad sectors until getting something that is coherent and consistent).. Then if the new partition is larger than the old partition, use the appropriate filesystem tool to enlarge the filesystem on that partition.
-- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On August 18, 2014 11:35:08 PM EDT, John Andersen
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out.
Have new drive ready to install in an external USB enclosure.
I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake).
I can either do this booting from the old drive or I have a bootable DVD Knopix around.
Is there any way to DD this drive across and take advantage of the full size of the newer drive?
My fallback is, of course a fresh install, and copy of files, but I was hoping to put that off till 13.2. (Its currently a very stable 12.3 and I have no desire to go to 31.1 at the this late date.)
Or is this a fools errand?
If you have a external usb-3 drive hanging around, or $100 (or less) to invest in one I would try ewfacquire to make a back up of the full physical drive as step one of my effort. Ewfacquire has a lot of dd like features, but it is really designed to make highly trusted backups of physical drives. If you output to EnCase format it will embed crc and md5 hash values in the backup so you know you can trust it / verify it. Zypper in libewf-tools will install it. It is designed to work with partially failing media, so things like the dd args of conv=noerror,sync etc. are not needed. It is not as robust as dd_rescue if your drive is in really bad shape. Ewfrestore can take the backup and restore it to a brand new drive. The above tools are on the "dfir" boot DVD in susestudio, so you can boot up that DVD, mount your external usb drive and then use ewfacquire to make the backup. Replace your drive and repeat the process but use ewfrestore the second time. Fyi: I use ewfacquire often in my day job. Maybe 100+ times a year. It is very robust and trusted. It will ask you questions when you run it. Just use the defaults or leave them blank if you don't understand the question. Greg Greg -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On 8/18/2014 8:35 PM, John Andersen wrote:
Smart throwing errors on my opensuse laptop drive. Occasional long pauses. The old drive is still bootable and runs but its clearly on its way out.
Have new drive ready to install in an external USB enclosure.
I want to see if I can just get everything off the failing drive onto the new drive while preserving the entire layout of partitions etc. Old drive 320Gig, New Drive 500Gig. (That might have been a mistake).
I can either do this booting from the old drive or I have a bootable DVD Knopix around.
Is there any way to DD this drive across and take advantage of the full size of the newer drive?
My fallback is, of course a fresh install, and copy of files, but I was hoping to put that off till 13.2. (Its currently a very stable 12.3 and I have no desire to go to 31.1 at the this late date.)
Or is this a fools errand?
Thanks for all the good clues guys, now I just have to decide among them. I will probably first try burn the Boot DVD Greg mentioned because I can do that without disturbing the existing system. I already have the replacement disk for any of these methods, unfortunately the machine is only capable of USB2, (laptop) so it isn't going to go all that fast. I have a firewire enclosure around here somewhere as well, and the machine has firewire. Luckily I have this disk backed up, and I don't need the machine right this instant. -- _____________________________________ ---This space for rent--- -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (5)
-
Bernhard Voelker
-
Dirk Gently
-
Felix Miata
-
Greg Freemyer
-
John Andersen