0

I am currently running out of an 8GB SD Card, I need to copy the drive to a 16GB SD Card.

dd from my research clones the partitions and the boot sector, etc.

The 8GB drive is encrypted, how do I cater for this and the drive being cloned / copied is in use, how do I deal with that so that any copy is exact and is their a verify setting?.

So far, the disk util says:

Ext2 (version 1.0) — Mounted at /boot

The /boot contains /dev/sda1, /dev/sda2 and s/dev/da5 and another partition /dev/mapper/sda5_crypt

I want it cloned to the 16GB SD Card which will need to be formatted as its W95 type fat table, states its read only, not sure why that is as it is definitely writable as it was in my camera up to a week ago.

Currently I have the following command:

dd if=/dev/sda of=/dev/sda conv=noerror,sync

Am I right that this will copy the entire disk with the sda2 et al partitions over to the drive that a fresh sda will be created?

** EDIT **

PROBLEM SOLVED

Just to let you know, the HDD died today, its not even spinning and made a god awful squeal, rebooted to find I can't enter BIOS until the HDD has been detected, Nice one AMI, way to go with that kind of programming...

0

1 Answer 1

1

Currently I have this command:-

dd if=/dev/sda of=/dev/sda conv=noerror,sync

Am I right that this will copy the entire disk with the sda2 et al partitions over to the drive that a fresh sda will be created?

Notice that you have a typo in your command. Output file should be the target drive, i.e. most likely sdb. Check which is the source drive and which is the target drive carefully before doing anything! If sda=source drive and sdb=target drive, the command would be:

dd if=/dev/sda of=/dev/sdb conv=noerror,sync

and, to answer your question, yes. But keep in mind that conv=noerror,sync will force bad blocks (if present) to be copied without any warning.

The 8GB drive is encrypted, how do I cater for this and the drive being cloned / copied is in use, how do I deal with that so that any copy is exact and is their a verify setting?

No problems in regard to the encryption, but absolutely don't clone the drive while it's in use. Boot from a live CD/DVD and do everything from there. Once done you can compare the drives using cmp; first of all you'll need to know the size of your first drive in byte. You can use fdisk to do this: in a terminal:

fdisk -l /dev/sda

Then:

cmp -n <size_of_sda_in_bytes> /dev/sda /dev/sdb

where <size_of_sda_in_bytes> is the size the first drive in byte. If there's no output, the drives match up to byte <size_of_sda_in_bytes>, i.e. the whole procedure succeded

8
  • Ok, so as long as I call my if & of drives after the devices are allocated a mount point under the LiveCD then all the /dev/sd* drives on the target /dev/sda are copied. I am confused by another site that stated that I would have to copy each partition separately. Feb 26, 2015 at 18:10
  • @MarkGiblin Can you post the link?
    – kos
    Feb 26, 2015 at 18:20
  • Can remember the site name, tried looking through the history folder but thats missing data, this FF browser crashes more times than a Windoze box, I have tried looking for it again and I can't remember where but do remember the comment regarding partitions and having to issue individual commands per partition. Anyway, I can't spend any more time on this subject, I really need to get this install sorted so I fix my PC. Feb 26, 2015 at 22:29
  • @MarkGiblin Ok, i was just curious, anyway the command you have will clone the specified drive to the new one as you expect, you can go with it, but again, be careful expecially when specifying the source drive and the target drive, and follow the advices i gave you in the answer
    – kos
    Feb 26, 2015 at 22:35
  • Having problems with copying, I get told that the action is not permitted. Feb 27, 2015 at 12:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .