I am running a home server with Debian 8. The hard disk started to show some signs of failure and I am planning to replace it. I am planning to just use dd and df commands in order to clone the content of the old hard drive on the new drive (using a live linux from USB). However, I have some questions before I proceed:

  1. Is it ok to clone a HDD with damaged sectors to a healthy HDD?
  2. Is the system going to boot normally if I use the procedure mentioned before?
  3. The root partition on the healthy drive, once cloned, will still be of the same size of the old drive. Can I expand it?
  4. Will the new hard drive be mounted on the same mountpoint (now it is on /dev/sdk)?
  5. Do you have any suggestion or better procedure?
  1. It's OK to clone the damaged disk to a good one - it won't harm the new disk. However, dd is not the ideal tool - look for the related one called ddrescue. It works the same way but will try very hard to get as much as it can.

  2. The system should boot normally unless you failed to copy some vital bit of the system because it couldn't be read.

  3. Expanding the root partition is really another topic. I would concentrate on getting the data while you still can.

  4. It will eventually. When using ddrescue, it won't be mounted on anything. You should not have the old disk mounted either, really. Boot a live CD or similar and do it from there (but you'll need to put ddrescue somewhere first).

  5. Better procedure - mainly, as I said, use ddrescue. Put it on a bootable USB stick or something similar.

The only thing I'm worried about is that you'll know which sectors have been copied, and which haven't - but how will you know what has been left behind/damaged? That is often an issue.

  • 1. Great, thanks! 2.I think no vital sectors are damaged as of now because the machine did not show any symptom of damaged hard drive, I just see SMART values getting worse and worse. 3. Ok, but is it possible and feasible? 4. I am planning to clone the HDD using clonezilla that is a live distro, my question was if the new HDD will be automatically mounted as the system drive when booting from it for the first time once the data has been cloned. 5. I will for sure follow the procedure of live distro and ddrescue. – giovi321 Jul 12 '17 at 10:24
  • 3. It's possible. Various methods but probably better asked as a separate question. I'm not an expert on Linux specifically. clonezilla is OK, but ddrescue will recover from errors better. It should mount fine though, if it appears as the same physical drive (i.e. it's plugged into the same place). Please mark as solved if that's all you need. – Bob Eager Jul 12 '17 at 10:44
  • The procedure was completed successfully. Thank you :) – giovi321 Jul 24 '17 at 10:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.