Difference between revisions of "Linux Mint: Disk image"

From fit-PC wiki
Jump to: navigation, search
(Tags: Mobile edit, Mobile web edit)
(Tags: Mobile edit, Mobile web edit)
 
Line 59: Line 59:
 
According to the example need to save 3 partitions:
 
According to the example need to save 3 partitions:
 
<pre>
 
<pre>
$ sudo partclone.ext4 -c -s /dev/sdf1 | lz4 > part1.ext4.partclone.lz
+
$ sudo partclone.ext4 -c -s /dev/sdf1 | lz4 > part1.ext4.partclone.lz4
$ sudo partclone.vfat -c -s /dev/sdf2 | lz4 > part2.vfat.partclone.lz
+
$ sudo partclone.vfat -c -s /dev/sdf2 | lz4 > part2.vfat.partclone.lz4
$ sudo partclone.ext4 -c -s /dev/sdf4 | lz4 > part4.ext4.partclone.lz
+
$ sudo partclone.ext4 -c -s /dev/sdf4 | lz4 > part4.ext4.partclone.lz4
 
</pre>
 
</pre>
 
7. Calculate md5 for files you've prepared
 
7. Calculate md5 for files you've prepared
 
<pre>
 
<pre>
$ md5sum *.layout part*.partclone.lz > md5sum
+
$ md5sum *.layout part*.partclone.lz4 > md5sum
 
</pre>
 
</pre>
8. Send us the fdisk.layout, blkid.layout, part*.partclone.lz files and the md5 file
+
8. Send us the fdisk.layout, blkid.layout, part*.partclone.lz4 files and the md5 file

Latest revision as of 11:52, 12 November 2019

Instructions for disk image preparation:

1. Obtain Linux workstation PC. Any recent Linux distribution is ok

2. Open the terminal and print current partitions

$ cat /proc/partitions

3. Attach the disk you are going to clone to the workstation PC and print detected partitions again:

$ cat /proc/partitions
...
8       80 30932992 sdf
8       81  2929664 sdf1
8       82    97280 sdf2
8       83    97280 sdf3
8       84   488448 sdf4

In the example above attached disk named /dev/sdf and it has 4 partitions: /dev/sdf1, /dev/sdf2, /dev/sdf3, /dev/sdf4

4. Open the terminal and save disk layout using fdisk tool:

$ echo -e "O\nfdisk.layout\nq\n" | sudo fdisk /dev/sdf
$ cat fdisk.layout
label: dos
label-id: 0x5a0ae517
device: /dev/sdf
unit: sectors

/dev/sdf1 : start=        2048, size=     5859328, type=83
/dev/sdf2 : start=     5861376, size=      194560, type=ef
/dev/sdf3 : start=     6055936, size=      194560, type=4
/dev/sdf4 : start=     6250496, size=      976896, type=83

5. Open the terminal and save disk layout using blkid tool:

$  sudo blkid /dev/sdf* -s UUID -s TYPE > blkid.layout
$ cat blkid.layout
/dev/sdf1: UUID="34b4205b-d2b9-4e50-9ea1-c559fdab97d3" TYPE="ext4"
/dev/sdf2: UUID="52DE-F66C" TYPE="vfat"
/dev/sdf4: UUID="025c89f7-eb46-424b-883b-23f7f0771b27" TYPE="ext4"

6. Save filesystem from each disk partition using partclone tool and compress using lz4 tool. Partclone tool supports ext2/3/4, ntfs, fat and many other filesystem types, you can clone disks with Linux or Windows installations Install required cloning software: "liblz4-tool" and "partclone"

# for distributions based on Ubuntu/Debian
$ sudo apt update
$ sudo apt install liblz4-tool partclone

In the example above according to blkid.layout:

/dev/sdf1 and /dev/sdf3 have "ext4" filesystem
/dev/sdf2 has "vfat" filesystem
/dev/sdf3 has no filesystem

According to the example need to save 3 partitions:

$ sudo partclone.ext4 -c -s /dev/sdf1 | lz4 > part1.ext4.partclone.lz4
$ sudo partclone.vfat -c -s /dev/sdf2 | lz4 > part2.vfat.partclone.lz4
$ sudo partclone.ext4 -c -s /dev/sdf4 | lz4 > part4.ext4.partclone.lz4

7. Calculate md5 for files you've prepared

$ md5sum *.layout part*.partclone.lz4 > md5sum

8. Send us the fdisk.layout, blkid.layout, part*.partclone.lz4 files and the md5 file