Difference between revisions of "Linux Mint: Disk image"
From fit-PC wiki
(Tags: Mobile edit, Mobile web edit) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Instructions for disk image preparation: | Instructions for disk image preparation: | ||
− | + | * Obtain Linux workstation PC. Any recent Linux distribution is ok | |
− | + | * Open the terminal and print current partitions | |
− | + | ||
<pre> | <pre> | ||
$ cat /proc/partitions | $ cat /proc/partitions | ||
</pre> | </pre> | ||
− | + | * Attach the disk you are going to clone to the workstation PC with some suitable adapter (for example M.2 SATA SSD to USB 3.0 adapter) | |
+ | * Print detected partitions again | ||
<pre> | <pre> | ||
$ cat /proc/partitions | $ cat /proc/partitions | ||
Line 17: | Line 17: | ||
8 84 488448 sdf4 | 8 84 488448 sdf4 | ||
</pre> | </pre> | ||
− | In the example above attached disk named /dev/sdf and it has 4 partitions: /dev/sdf1, /dev/sdf2, /dev/sdf3, /dev/sdf4 | + | * In the example above attached disk named /dev/sdf and it has 4 partitions: /dev/sdf1, /dev/sdf2, /dev/sdf3, /dev/sdf4 |
− | + | * We will use the name /dev/sdf in this guide, it can be different in your case | |
− | + | <br> | |
+ | * Open the terminal and save disk layout using fdisk and blkid tools: | ||
<pre> | <pre> | ||
$ echo -e "O\nfdisk.layout\nq\n" | sudo fdisk /dev/sdf | $ echo -e "O\nfdisk.layout\nq\n" | sudo fdisk /dev/sdf | ||
+ | |||
+ | # review fdisk.layout file | ||
$ cat fdisk.layout | $ cat fdisk.layout | ||
label: dos | label: dos | ||
Line 32: | Line 35: | ||
/dev/sdf3 : start= 6055936, size= 194560, type=4 | /dev/sdf3 : start= 6055936, size= 194560, type=4 | ||
/dev/sdf4 : start= 6250496, size= 976896, type=83 | /dev/sdf4 : start= 6250496, size= 976896, type=83 | ||
− | |||
− | + | $ sudo blkid /dev/sdf* -s UUID -s TYPE > blkid.layout | |
− | + | ||
− | $ | + | # review blkid.layout file |
$ cat blkid.layout | $ cat blkid.layout | ||
/dev/sdf1: UUID="34b4205b-d2b9-4e50-9ea1-c559fdab97d3" TYPE="ext4" | /dev/sdf1: UUID="34b4205b-d2b9-4e50-9ea1-c559fdab97d3" TYPE="ext4" | ||
Line 43: | Line 45: | ||
</pre> | </pre> | ||
− | + | * Ensure disk partitions are unmounted (on some systems they can be mounted automatically) | |
− | + | <pre> | |
+ | $ sudo umount /dev/sdf* | ||
+ | </pre> | ||
+ | |||
+ | * 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" | Install required cloning software: "liblz4-tool" and "partclone" | ||
<pre> | <pre> | ||
Line 59: | Line 66: | ||
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. | + | $ sudo partclone.ext4 -c -s /dev/sdf1 | lz4 > part1.ext4.partclone.lz4 |
− | $ sudo partclone.vfat -c -s /dev/sdf2 | lz4 > part2.vfat.partclone. | + | $ sudo partclone.vfat -c -s /dev/sdf2 | lz4 > part2.vfat.partclone.lz4 |
− | $ sudo partclone.ext4 -c -s /dev/sdf4 | lz4 > part4.ext4.partclone. | + | $ sudo partclone.ext4 -c -s /dev/sdf4 | lz4 > part4.ext4.partclone.lz4 |
</pre> | </pre> | ||
− | + | * Calculate md5 for files you've prepared | |
<pre> | <pre> | ||
− | $ md5sum *.layout part*.partclone. | + | $ md5sum *.layout part*.partclone.lz4 > md5 |
</pre> | </pre> | ||
− | + | * Send us the fdisk.layout, blkid.layout, part*.partclone.lz4 files and the md5 file |
Latest revision as of 10:11, 27 January 2020
Instructions for disk image preparation:
- Obtain Linux workstation PC. Any recent Linux distribution is ok
- Open the terminal and print current partitions
$ cat /proc/partitions
- Attach the disk you are going to clone to the workstation PC with some suitable adapter (for example M.2 SATA SSD to USB 3.0 adapter)
- 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
- We will use the name /dev/sdf in this guide, it can be different in your case
- Open the terminal and save disk layout using fdisk and blkid tools:
$ echo -e "O\nfdisk.layout\nq\n" | sudo fdisk /dev/sdf # review fdisk.layout file $ 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 $ sudo blkid /dev/sdf* -s UUID -s TYPE > blkid.layout # review blkid.layout file $ 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"
- Ensure disk partitions are unmounted (on some systems they can be mounted automatically)
$ sudo umount /dev/sdf*
- 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
- Calculate md5 for files you've prepared
$ md5sum *.layout part*.partclone.lz4 > md5
- Send us the fdisk.layout, blkid.layout, part*.partclone.lz4 files and the md5 file