the most popular partition editors for Linux
1 Gparted
2 gnome disks
3 KDE Partition Manager
4 Fdisk
5 cfdisk
6 GNU Parted
7 Qtparted
1.GParted is a partition editor for the GNOME desktop environment. This application is used to create, delete, resize, inspect and copy partitions, as well as the file systems found on them. This is useful to create space for new operating systems, rearrange disk usage and create disk images on a partition.
2.What Gnome Disks is a graphical front-end of udisks included in the gnome-disk-utility package this is another partition editor that belongs to the Gnome project.
3.KDE Partition Manager This is a partition editor, which makes use of the GNU Parted library, to allow the user to manage partitions, of which the tasks it allows to perform we find the following:
Create, delete, check, resize and copy partitions and the file systems on them.
4.Fdisk
This is another of the many most popular partition managers in Linux, Fdisk is included in most Linux distributions and it is usually the tool of this type most used by users.
Fdisk allows the user to do what any partition manager can do, what makes Fdisk special is that it is not an exclusive tool for Linux, but it is cross-platform.
5. Cfdisk - a partition editor similar to fdisk, since its use is also through the command line, but with a different interface than fdisk, cfdisk tries to read partition tables from disk, showing found ones.
6. GNU Parted Parted is a popular command line tool for managing hard disk partitions. It supports multiple partition table formats, including MS-DOS, GPT, BSD and many more. With it, you can add, delete, shrink and extend disk partitions along with the file systems located on them.
7. In addition, you can also use Qtparted, is a Partition Magic (proprietary software for Windows) clone and Qt front-end to GNU Parted. Note that it still in development and you may likely experience any kind of problem with latest release
creating a disk image
Creating a Disk Image
One of the way to clone a drive is to create a disk image that you can move around and restore as you would do with a bootable USB.
Creating image files allows you to save multiple backups to a single destination, such as a large portable hard drive. Again, this process only requires one command:
dd if=/dev/sdX of=path/to/your-backup.img
To save space, you can have dd compress your backup.
dd if=/dev/sdX | gzip -c > path/to/your-backup.img.gz
Restoring a Drive With dd
First command:
dd if=/dev/sdY of=/dev/sdX
When restoring from an image file, the same concept applies:
dd if=path/to/your-backup.img of=/dev/sdX
If your image file is compressed, then things get a little different. Use this command instead:
gunzip -c /path/to/your-backup.img.gz | dd of=/dev/sdX
To be clear, gunzip is "g unzip," as in the opposite of "g zip." This command decompresses your backup. Then dd replaces the existing drive with this image.
Parameters to Consider
You can alter your command by sticking a parameter at the end. By default, dd can take a while to transfer data. You can speed up the process by increasing the block size. Do so by adding bs= at the end.
dd if=/dev/sdX of=/dev/sdY bs=64
This example increases the default block size from 512 bytes to 64 kilobytes.
conv=noerror tells dd to continue despite any errors that occur. The default behavior is to stop, resulting in an incomplete file. Keep in mind that ignoring errors isn't always safe. The resulting file may be corrupted.
conv=sync adds input blocks with zeroes whenever there are any read errors. This way data offsets remain in sync.
You can combine these last two as conv=noerror,sync if you so desire. There is no space after the comma.
How to make disk image with dd on Linux or Unix
How to make disk image with dd on Linux or Unix
How to clone an entire hard disk
The syntax is as follow to make disk image with dd:dd if=/dev/input/DEVICE-HERE of=/dev/OUTPUT/DEVICE-HERE bs=64K conv=noerror,sync
To clone /dev/sdc (500G) to /dev/sdd (500G) in Linux, enter:# dd if=/dev/sdc of=/dev/sdd bs=64K conv=noerror,sync
In this example, I am going to clone /dev/ada0 (500G) to /dev/adb0 (500G) in FreeBSD and make an image using dd. For example:# dd if=/dev/ada0 of=/dev/adb0 bs=64K conv=noerror,sync
Where,
- if=/dev/file : Input device/file.
- of=/dev/file : Output device/file.
- bs=64k : Sets the block size to 64k. You can use 128k or any other value.
- conv=noerror : Tell dd to continue operation, ignoring all read errors.
- sync : Add input blocks with zeroes if there were any read errors, so data offsets stay in sync.
How to clone a partition and make disk image with dd
To clone /dev/sdc1 to /dev/sdd1 with dd and create an image, enter:# dd if=/dev/sdc1 of=/dev/sdd1 bs=128K conv=noerror,sync
Making disk image with dd using live CD/DVD or USB pen drive You can boot from a live cd or USB pen drive. Once booted, make sure no partitions are mounted from the source hard drive disk. You can store disk image on an external USB disk. The syntax is as follows dd if=/dev/INPUT/DEVICE-NAME-HERE conv=sync,noerror bs=64K | gzip -c > /path/to/my-disk.image.gz In this example, create disk image for /dev/da0 i.e. cloning /dev/da0 and save in the current directory: dd if=/dev/da0 conv=sync,noerror bs=128K | gzip -c > centos-core-7.gz
How to restore system (dd image) The syntax is: gunzip -c IMAGE.HERE-GZ | dd of=/dev/OUTPUT/DEVICE-HERE For example: gunzip -c centos-core-7.gz | dd of=/dev/da0 Tip #1: Not enough disk space locally? Use the remote box You can send the image through ssh and save it on the remove box called
user: dd if=/dev/da0 conv=sync,noerror bs=128K | gzip -c | ssh user 'dd of=centos-core-7.gz' You can see status with dd command as follows: dd if=/dev/da0 conv=sync,noerror bs=128K status=progress | gzip -c | ssh user 'dd of=centos-core-7.gz' Here is how to restore image from local system: The syntax is: ssh user 'dd if=disk.img' | dd of=/dev/sdb ## OR ## ssh user 'dd if=centos-core-7.gz' | gunzip -c | dd of=/dev/sdb ## add status=progress if needed
## ssh user 'dd if=centos-core-7.gz status=progress' | gunzip -c | dd of=/dev/sdb Tip #2: See progress while making an image with dd You need to use GNU/BSD dd with coreutils version 8.24 as follows (pass the status=progress to the dd): dd if=/dev/sdc1 of=/dev/sdd1 bs=128K conv=noerror,sync status=progress
How to Make Disk Images in Linux with DD Command
How to Make Disk Images in Linux with DD Command
Install LSSCSI Utility
Open the command-line terminal.
Make sure to have the “lsscsi” utility installed on your system. If it is not installed, try to install it using the below “apt” command followed by the keyword “install” and “lsscsi”.
sudo apt install lsscsi
After installing the “lsscsi” utility, now it’s time to use it for listing all the storage devices of our Linux system.
$ lsscsi
Check Disk Information
$ sudo fdisk /dev/sda
Create a Clone Disk Image
Now you have almost every piece of information regarding the “/dev/sda” drive. Press “q” to exit the commanding theme. Now, you are ready to make a disk image using the DD command.
$ sudo dd if=/dev/sda1 of=/tmp/sda.img bs=1k conv=noerror
Let’s check the destination image file to see if all the data from the source drive has been cloned into it properly or not. Use the below list command along with the path of an image file of the drive as:
The output shows the rights assigned to this image file, its size, and location. You can say that it has similar rights and size as the original disk drive have.
To see some more information regarding the disk image file, you have to try the below “fdisk” command followed by the flag “-l” as below.
Restore the Drive from Clone Image
Now, if you want to restore your original disk drive along with all the data it has, you have to use the DD command again to do so.
$ sudo dd if=/tmp/sda1.img of=/dev/sda1 bs=1k conv=noerror