3
February
2022
Setting partition flags after cloning a disk in CloneZilla
16:48

Setting partition flags after cloning a disk in CloneZilla

3 February 2022 16:48

After cloning "Disk to Disk" with the "sector to sector" option, booting from the resulting disk failed, because The required flag is not set on the resulting disk partition.

I used sector-to-sector cloning for a disk with MBR partitioning for the hard disk in my netbook. Initially, Windows 7 was installed on it, I installed MX Linux next to it and updated it. In order not to waste time on reinstallation after experiments, I decided to make an exact copy of the netbook’s hard drive onto an external hard drive of the same capacity (320 GB), connected via a USB-SATA adapter.

The symptoms are: Disk cloning in Clonezilla is 100% complete. But in the end, errors appeared about “/dev/sdb1 not found”, “/dev/sdb2 not found”, as a result of which final changes were not made to the file system of the clone disk.

After such a sector-to-sector copy, I could not boot from the resulting disk to which I copied. The reason turned out to be service flags. They need to be installed manually in GParted (Start - System - GParted).

  1. ntfs Windows partition /dev/sda1 "Reserved by the system" - contains the bootloader. Putting up a flag boot
  2. The second ntfs partition /dev/sda2, the main one for Windows OS, is not marked with flags.
  3. The third partition /dev/sda3 I had was fat32 (left over from the partition?) - not marked with flags
  4. The extended partition /dev/sda4 (extended) is not marked with flags.
  5. The Linux root partition allocated to the "root" (/) of the /dev/sda5 volume is not flagged.
  6. The Linux home folder ("/home") of the /dev/sda6 volume and the partition labeled "swap" are also not flagged.

If Linux does not start with an error in English, what Boot device not found, boot your computer from LiveCD (LiveUSB), run sudo gparted and set the boot flag correctly "boot":

  • when marking MBR (DOS) on the first partition, i.e. "Reserved by the system", flags "boot" and "lba"
  • when marking GPT (UEFI) on the ESP partition, the flags "boot" and "efi"
    (To set the flag to gparted: select a section, right mouse button -Flag management).

You can find out the partition type MBR or GPT with the command sudo gdisk /dev/sda

If the disk layout is DOS (MBR), then in BIOS SETUP we put the desired hard drive first in the boot order.

 

This article does not cover the GPT markup option. You can find it in the article "Installing Linux on UEFI" on the losst website. The article talks about converting MBR to GPT "EFI System Partition Configuration".

Linux boots for any type of markup with the UUID specified in /etc/fstab.

  • First, find out the UUID of the disk using blkid. For example:

    lsblk
    blkid /dev/sda7 #disk where /boot is (can correspond to root /)

Then, if the UUID has changed, you need to correct it in gksudo nano /etc/fstab and correct the UUID.


Last change: 07/17/2025 The article has been clarified and external links have been added.


Links:
*Parted



Related publications