I have an SSD drive that a special Operating System installed on it and has some partitions with different sizes. I want to clone it on another SSD. Is below command enough?
Code: Select all
# dd if=/dev/XXX of=/home/jason/SSD.dd
Thank you.
Code: Select all
# dd if=/dev/XXX of=/home/jason/SSD.dd
No. The command does not clone a drive on another, it only creates an image file from the source drive. You must also write the image to the destination drive.hack3rcon wrote:I have an SSD drive that a special Operating System installed on it and has some partitions with different sizes. I want to clone it on another SSD. Is below command enough?
Thank you so much for your useful information. I have some questions:p.H wrote:No. The command does not clone a drive on another, it only creates an image file from the source drive. You must also write the image to the destination drive.hack3rcon wrote:I have an SSD drive that a special Operating System installed on it and has some partitions with different sizes. I want to clone it on another SSD. Is below command enough?
Also note that :
- If the destination drive is smaller than the source drive, it won't work.
- If the destination drive is bigger than the source drive and the partition scheme is GPT, the available size recorded in the GPT header on the destination drive will be wrong and the backup partition table which is expected to be located at the end of the drive will be at the wrong location unless you run some partitioning tool to fix the partition table.
- dd copies all blocks, used and unused. It is a waste of time and wears the destination. Also, unused copied blocks will be uselessly marked "in use" by the destination SSD unless you run fstrim on each filesystem afterwards. Depending on the partition scheme and filesystem type, clonezilla may be able to copy only used blocks.
- The operating system may not be happy to be moved to another drive without notice. For instance, the Debian package grub-pc (for BIOS boot) records the physical identifier /dev/disk/by-id/xxx of the drive the boot loader was installed to, so that it can reinstall it in the same location after an update.
What should I do about UUID?mm3100 wrote:Yes I think that command of yours will do what you want, just be careful of UUID, since dd will copy those as well.
I already replied to this question in my previous post.hack3rcon wrote:1- If the destination drive is bigger than the source drive then what should I do?
Can you elaborate ?hack3rcon wrote:2- How about "fstrim" ?
Change the drive identification in relevant configurations. The only one I know in Debian is grub-pc debconf configuration, so you would juste have to runhack3rcon wrote:3- "The operating system may not be happy to be moved to another drive without notice.", then what are the options?
Code: Select all
dpkg-reconfigure grub-pc
Nothing if you are not going to use both drives in the same machine at the same time.hack3rcon wrote:What should I do about UUID?
This! >> GPARTED COPY/PASTEhack3rcon wrote:Hello,
I have an SSD drive that a special Operating System installed on it and has some partitions with different sizes. I want to clone it on another SSD. Is below command enough?This command will clone all parts of SSD like Boot partition and...?Code: Select all
# dd if=/dev/XXX of=/home/jason/SSD.dd
Thank you.
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...
Code: Select all
lsblk -f
It's a very good idea. A bad idea is to mix purpose on a device and complicate it's archival. If you have 100GB of crap mixed in your OS it would be silly to try and image the whole disk, so think ahead maybe. I image to and fro on device and as a file on a regular basis. An OS archives to a few GB's, you can keep that on the simplest phone or usb, or a master spinning rust. I do windows too, for Debian only a single master image is needed for each architecture. UUID's, PTUUID's, domains, users are changeable. A few dozen OS's can be quickly unique-ified at will. User skel's can be zipped and applied to fresh OS copies. User data bought in from separate image files and devices.bester69 wrote: i think clonning whole disk is a very bad idea.
Totally agree and that's why I use a separate partition for all my data instead of dumping it all in /home . Restores or new distro installs are a piece of cake. My largest OS image using fsarchiver is ~6GB.CwF wrote:It's a very good idea. A bad idea is to mix purpose on a device and complicate it's archival. If you have 100GB of crap mixed in your OS it would be silly to try and image the whole disk, so think ahead maybe.bester69 wrote: i think clonning whole disk is a very bad idea.
When I initially install Debian, I create /home in a separate partition (sometimes a separate drive.) That makes backups, restores or new Distro installs a piece of cake. I love performing a fresh install without formatting the /home partition, using my old /home partition, and having my setting and data preserved. (Of course, I create a backup first.) A clean install of Debian, say from Stretch to Buster, takes about 15 to 20 minutes, on a computer that isn't too old, using an SSD.sunrat wrote: [...] that's why I use a separate partition for all my data instead of dumping it all in /home . Restores or new distro installs are a piece of cake. [...]
by the way, right now ive my system fsarchiver backup (7Gb) uploading to box (I do one or two uploads per year) cloud with duplicity and rclone backend at just 100KB/seg, it will take around tree or four days to upload whole system backup.. at that slow speed.. but it pays off; duplicity is as reliable as btrfs in my experience and resuming operations never fails (seems unbreakable ).. and box cloud us very reliable as well.sunrat wrote:...
Restores or new distro installs are a piece of cake. My largest OS image using fsarchiver is ~6GB.
......
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...
Code: Select all
$ lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sdc
├─sdc1
│ vfat /sysro
│ 020C-0000
├─sdc2
│ vfat /db 0257-0000
├─sdc3
│ vfat /vmail
│ 02F6-0000
├─sdc4
│
├─sdc5
│ vfat /sysro
│ 036A-0000
├─sdc6
│ vfat /db 037F-0000
└─sdc7
vfat /unused
03FA-0000
Code: Select all
$ sudo umount /dev/sdcX
Code: Select all
$ sudo dd if=/dev/sdc of=/home/jason/SSD.dd
234441648+0 records in
234441648+0 records out
120034123776 bytes (120 GB, 112 GiB) copied, 2850.17 s, 42.1 MB/s
Code: Select all
$ file SSD.dd
SSD.dd: DOS/MBR boot sector; partition 1 : ID=0x6, active, start-CHS (0x0,1,1), end-CHS (0x8f,254,63), startsector 63, 2313297 sectors; partition 2 : ID=0xb, start-CHS (0x90,0,1), end-CHS (0x3ea,254,63), startsector 2313360, 13799835 sectors; partition 3 : ID=0xc, start-CHS (0x3eb,0,1), end-CHS (0x3ff,254,63), startsector 16113195, 29543535 sectors; partition 4 : ID=0xf, start-CHS (0x3ff,0,1), end-CHS (0x3ff,254,63), startsector 45656730, 188784918 sectors
Code: Select all
# dd if=/home/jason/SSD.dd of=/dev/sdc