1

I want to clone a centos 7 installation (using LVM) from a 500GB drive (using MBR) to a new 6TB HDD.

I tried to use clonezilla to clone the the drives with no success.

fdisk -l output from clonezilla:

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 512 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xb76941c5

   Device  Boot Start       End   Sectors   Size Id  Type
/dev/sda1        2048 976771071 976769024 465.8G  6 FAT16

fdisk -l output from centos:

[root@xxx ~]# fdisk -l
Disk /dev/sda: 499.9 GB, 499949502464 bytes, 976463872 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos<
Disk identifier: 0x0008eb5b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048   976463871   487718912   8e  Linux LVM

Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/centos-swap: 8455 MB, 8455716864 bytes, 16515072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mapper/centos-home: 437.2 GB, 437210054656 bytes, 853925888 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

The LVM configuration:

[root@xxx ~]# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               centos
  PV Size               465.12 GiB / not usable 4.00 MiB
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              119071
  Free PE               16
  Allocated PE          119055
  PV UUID               7Hmn3i-k2N3-Mij7-i2ae-8M1A-zoTm-PXiM9V

[root@xxx ~]# vgdisplay
  --- Volume group ---
  VG Name               centos
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  4
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                3
  Open LV               3
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               465.12 GiB
  PE Size               4.00 MiB
  Total PE              119071
  Alloc PE / Size       119055 / <465.06 GiB
  Free  PE / Size       16 / 64.00 MiB
  VG UUID               EKC98O-RtWr-DDVl-Bx2I-w5Ln-v3Q1-hhzcey

[root@xxx ~]# lvdisplay
  --- Logical volume ---
  LV Path                /dev/centos/swap
  LV Name                swap
  VG Name                centos
  LV UUID                25Sbxn-slkp-mSzY-5xGI-h5cd-qhrh-VCkYj7
  LV Write Access        read/write
  LV Creation host, time xxx, 2016-08-03 14:55:21 +0300
  LV Status              available
  # open                 2
  LV Size                <7.88 GiB
  Current LE             2016
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1

  --- Logical volume ---
  LV Path                /dev/centos/home
  LV Name                home
  VG Name                centos
  LV UUID                ybaeQV-7PIO-Te4k-61hH-JBkU-hUG7-Pas1X7
  LV Write Access        read/write
  LV Creation host, time xxx, 2016-08-03 14:55:22 +0300
  LV Status              available
  # open                 1
  LV Size                407.18 GiB
  Current LE             104239
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:2

  --- Logical volume ---
  LV Path                /dev/centos/root
  LV Name                root
  VG Name                centos
  LV UUID                cFJJ2z-kHGg-NFbo-SwtL-hw1L-MkSm-0lz5ez
  LV Write Access        read/write
  LV Creation host, time xxx, 2016-08-03 14:55:23 +0300
  LV Status              available
  # open                 1
  LV Size                50.00 GiB
  Current LE             12800
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

Any suggestions on how to proceed using clonezilla or some other cloning utility?

GioLit
  • 11
  • 1
  • 1
  • 1
    you have several problems: 1° your Clonezilla has an old version of fdisk that doesn't understand GPT. Prefer parted instead : `parted /dev/sda print` – wazoox Jan 15 '19 at 18:41
  • 2° Linux is wonderful. You can clone your system much more easily simply using "cp": partition your destination drive as you wish, make filesystems, mount and copy with a simple `cp -ax /source/* /destination/`, edit your /destination/etc/fstab, then run `for FS in /dev /proc /sys ; do mount -B $FS /destination/$FS ; done ; chroot /destination "grub-install /dev/newdisk"` and that's it. – wazoox Jan 15 '19 at 18:45
  • /dev/sda is not formatted using GTP. It uses plain MBR. What troubles me the most is that clonezilla (using fdisk) list only one device (/dev/sda1) while centos two (/dev/sda1 /dev/sda2) – GioLit Jan 16 '19 at 09:34
  • Those are two different disks; not the same number of blocks, not the same MBR ID, not even the same physical block size. You posted the configuration of two different disks -- sda under one OS can be sdb under another. – wazoox Jan 16 '19 at 11:42
  • The output of fdisk commands refers to the same disk. First output is running clonezilla (live disk), second output from os (centos 7) – GioLit Jan 16 '19 at 14:15
  • How do you explain that they have different sizes, geometry and block size? What's the output of `lsblk`? – wazoox Jan 17 '19 at 16:34

0 Answers0