Cloning a Drive in Linux via Commands: Difference between revisions
mNo edit summary |
mNo edit summary |
||
| Line 31: | Line 31: | ||
*** File System: <code>dd if=/dev/VG.NVMe.P3/LV.ROOT.SnapShot bs=64M iflag=fullblock status=progress conv=noerror,sync | pigz -1 -c > /BackUps/LV.ROOT.SnapShot.gz</code> | *** File System: <code>dd if=/dev/VG.NVMe.P3/LV.ROOT.SnapShot bs=64M iflag=fullblock status=progress conv=noerror,sync | pigz -1 -c > /BackUps/LV.ROOT.SnapShot.gz</code> | ||
*** Delete the SnapShot: <code>lvremove -f /dev/VG.NVMe.P3/LV.ROOT.SnapShot</code> | *** Delete the SnapShot: <code>lvremove -f /dev/VG.NVMe.P3/LV.ROOT.SnapShot</code> | ||
** | ** nvme1n1p4; | ||
*** LVM Configuration: <code>dd if=/dev/nvme1n1p4 of=/BackUps/nvme1n1p4.LVM bs=512 count=2048 iflag=fullblock status=progress conv=noerror,sync</code> | *** LVM Configuration: <code>dd if=/dev/nvme1n1p4 of=/BackUps/nvme1n1p4.LVM bs=512 count=2048 iflag=fullblock status=progress conv=noerror,sync</code> | ||
*** Create a Snapshot: <code>lvcreate --snapshot -l 100%FREE --name "LV.Storage.SnapShot" "/dev/VG.NVMe.P4/LV.Storage"</code> | *** Create a Snapshot: <code>lvcreate --snapshot -l 100%FREE --name "LV.Storage.SnapShot" "/dev/VG.NVMe.P4/LV.Storage"</code> | ||
*** File System: <code>dd if=/dev/VG.NVMe.P4/LV.Storage.SnapShot bs=64M iflag=fullblock status=progress conv=noerror,sync | pigz -1 -c > /BackUps/LV.Storage.SnapShot.gz</code> | *** File System: <code>dd if=/dev/VG.NVMe.P4/LV.Storage.SnapShot bs=64M iflag=fullblock status=progress conv=noerror,sync | pigz -1 -c > /BackUps/LV.Storage.SnapShot.gz</code> | ||
*** Delete the SnapShot: <code>lvremove -f /dev/VG.NVMe.P4/LV.Storage.SnapShot</code> | *** Delete the SnapShot: <code>lvremove -f /dev/VG.NVMe.P4/LV.Storage.SnapShot</code> | ||
** nvme1n1p5: <code>dd if=/dev/nvme1n1p5 of=/BackUps/nvme1n1p5 bs=64M iflag=fullblock status=progress conv=noerror,sync,fsync</code> | |||
==== Step(s) 2 - Restoration ==== | ==== Step(s) 2 - Restoration ==== | ||
Restore to the Destination Drive: <code>sgdisk --load-backup=WhatEverFileName.bak /dev/WhatEverSDy</code> | Restore to the Destination Drive: <code>sgdisk --load-backup=WhatEverFileName.bak /dev/WhatEverSDy</code> | ||
| Line 48: | Line 46: | ||
continue with the current setting?", it is probably because of a mismatch in size between the Source and Destination Drives Storage Capacity. Easy to fix with: <code>parted /dev/SDy, print, Fix</code> | continue with the current setting?", it is probably because of a mismatch in size between the Source and Destination Drives Storage Capacity. Easy to fix with: <code>parted /dev/SDy, print, Fix</code> | ||
=== And for the Critics === | |||
nvme1n1p1 and nvme1n1p2: Yes it would be great if a SnapShot could be taken of these too, but as far as research and experiments have shown, UEFI will not tolerate that, so it won't work. Plus, realistically, what's gonna change on those Partitions in the brief time DD is running for them? Hint: NOTHING! | |||
SWAP: Yes, the SWAP partition could just be recreated, and it won't be consistent, etc. when cloned with DD, but it doesn't make a difference at all because when the cloned system boots, the SWAP Partition is essentially reset. Interesting question on which is faster, and whether one could run the various commands to create a new SWAP Partition, with the same parameters, UUID, etc. VS running the DD restore command. | |||