×

Pages

Labels

Search

×

Pages

×
×

Notice

The site is currently undergoing scheduled maintenance, and may not function correctly. Please come back later.

Advertisement

advertisement

Backup And Restore GPT And Partitions, Using DD And Gdisk Under Lubuntu 16.04 AMD64

Backup GPT:
1. In terminal type "sudo apt-get install gdisk".
2. In terminal type "sudo gdisk"
3. In Gdisk type "/dev/sdL", substitute "sdL" for the device to backup the GPT of.
4. In Gdisk type "b".
5. In Gdisk type "/directory/gpt.gdisk", substitute for the path to and name of the file you wish to create.
6. In Gdisk type "q".

Restore GPT:
1. In terminal type "sudo apt-get install gdisk".
2. In terminal type "sudo gdisk"
3. In Gdisk type "/dev/sdL", substitute "sdL" for the device the GPT is being restored to.
4. In Gdisk type "r".
5. In Gdisk type "l" (that's a small "L").
6. In Gdisk type "/directory/gpt.gdisk", substitute for the path to and name of the GPT backup file.
7. In Gdisk type "w".

Backup Partition:
1. In terminal type "sudo mkdir "/directory". Substitute "/directory" for you desired mount point (eg: "/media/mnt1").
2. In terminal type "sudo mount "/dev/sdL#" "/directory". Substitite "sdL#" for the partition being backed up. Substitute "/directory" for you desired mount point (eg: "/media/mnt1"), which you previously created.
3. In terminal type "sudo dd if="/dev/zero" of="/directory/zero.img" bs=512". Substitute "/directory" for the mount point you previously created.
4. In terminal type "sudo rm "/directory/zero.img". Substitute "/directory" for the mount point you previously created.
5. In terminal type "sudo umount "/directory". Substitute "/directory" for the mount point you previously created.
6. In terminal type "sudo dd if="/dev/sdL# bs=512 conv=noerror | gzip --keep --stdout -9 > "/directory/partition.img.gz"". Substitute "sdL#" for the partition being backed up. Substitute "/directory/partition.img.gz" for the path to and name of the partition backup file.

Restore Partition:
1. In terminal type "sudo gzip --keep --decompress --stdout "/directory/partition.img.gz" | sudo dd of="/dev/sdL# bs=512. Substitute "/directory/partition.img.gz" for the path to and name of the partition backup file. Substitute "sdL#" for the partition being restored to.

Notes:
- These steps use gzip compression at max. Greater compression could potentially be achieved using xz compression instead.
- These steps zero empty sectors on a partition when it's being backed up. Something to keep in mind for SSDs.
- Using a blocksize above 512 for zeroing may speed things up, but don't surpass the write speeds of the device.

License:Comprehensible Open License 1.0
Comprehensible Open License 1.0:

Material published under this license can be modified, forked, incorporated into other works, and distributed, provided the material remains under this license. Material published under this license is free of charge! Material published under this license is bound to the license release number it was published under. Material published under this license is provided as is. The author of material published under this license shan't be held liable for any negative occurrences that arise from use of the material the author published under this license.
Post Download Link (1.0 Stable): https://mega.nz/#!RQkmDShS!FpP8OfB-khBTPle3p_fp67_cyhFGT_ZMyuS-9RlTOf0

Advertisment

advertisement
Copyright © James Daniel Marrs Ritchey.

Siteviews