Menu

How to clone Linux OS on RAID 5 to a VM with non-RAID

Help
2025-03-31
2025-04-08
  • The_Immortal

    The_Immortal - 2025-03-31

    Dear Sirs,

    I am completely new to Clonezilla and the Linux world in general. However, I need to clone a Linux OS running on a RAID 5 array (3 disks) to a virtual machine with a non-RAID setup (1 disk).

    Most YouTube tutorials cover only simple cases, such as copying one entire disk to another, but my situation is more complex.

    Here is the configuration of my source Fedora 32-bit system:

    # df -h
    Filesystem      Size  Used Avail Use% Mounted on
    devtmpfs        3.9G     0  3.9G   0% /dev
    tmpfs           3.9G     0  3.9G   0% /dev/shm
    tmpfs           3.9G  992K  3.9G   1% /run
    tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
    /dev/md0         50G   43G  3.8G  93% /
    tmpfs           3.9G  8.0K  3.9G   1% /tmp
    /dev/sdc2       194M  163M   22M  89% /boot
    /dev/md4        1.8T  614G  1.1T  37% /home
    /dev/md1         59G   24G   33G  42% /var/log
    /dev/md2        148G   60M  140G   1% /backup
    /dev/md5        3.1T  811G  2.1T  28% /var/samba
    /dev/md3        394G  374G     0 100% /var/lib/mysql
    tmpfs           798M     0  798M   0% /run/user/0
    
    # lsblk -o NAME,FSTYPE,MOUNTPOINT,LABEL,PARTTYPE,PARTLABEL
    NAME    FSTYPE            MOUNTPOINT     LABEL                   PARTTYPE                             PARTLABEL
    sda
    ├─sda1                                                           21686148-6449-6e6f-744e-656564454649 BIOS boot partition
    ├─sda2  ext2                                                     0fc63daf-8483-4772-8e79-3d69d8477de4 Linux filesystem
    ├─sda3  linux_raid_member                localhost.localdomain:0 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md0 ext4              /
    ├─sda4  swap                                                     0657fd6d-a4ab-43c4-84e5-0933c84b4f4f Linux swap
    ├─sda5  linux_raid_member                localhost.localdomain:1 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md1 ext4              /var/log
    ├─sda6  linux_raid_member                localhost.localdomain:2 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md2 ext4              /backup
    ├─sda7  linux_raid_member                localhost.localdomain:3 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md3 ext4              /var/lib/mysql
    ├─sda8  linux_raid_member                localhost.localdomain:4 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md4 ext4              /home
    └─sda9  linux_raid_member                localhost.localdomain:5 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
      └─md5 ext4              /var/samba
    sdb
    ├─sdb1                                                           21686148-6449-6e6f-744e-656564454649 BIOS boot partition
    ├─sdb2  ext2                                                     0fc63daf-8483-4772-8e79-3d69d8477de4 Linux filesystem
    ├─sdb3  linux_raid_member                localhost.localdomain:0 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md0 ext4              /
    ├─sdb4  swap                                                     0657fd6d-a4ab-43c4-84e5-0933c84b4f4f Linux swap
    ├─sdb5  linux_raid_member                localhost.localdomain:1 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md1 ext4              /var/log
    ├─sdb6  linux_raid_member                localhost.localdomain:2 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md2 ext4              /backup
    ├─sdb7  linux_raid_member                localhost.localdomain:3 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md3 ext4              /var/lib/mysql
    ├─sdb8  linux_raid_member                localhost.localdomain:4 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md4 ext4              /home
    └─sdb9  linux_raid_member                localhost.localdomain:5 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
      └─md5 ext4              /var/samba
    sdc
    ├─sdc1                                                           21686148-6449-6e6f-744e-656564454649 BIOS boot partition
    ├─sdc2  ext2              /boot                                  0fc63daf-8483-4772-8e79-3d69d8477de4 Linux filesystem
    ├─sdc3  linux_raid_member                localhost.localdomain:0 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md0 ext4              /
    ├─sdc4  swap                                                     0657fd6d-a4ab-43c4-84e5-0933c84b4f4f Linux swap
    ├─sdc5  linux_raid_member                localhost.localdomain:1 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md1 ext4              /var/log
    ├─sdc6  linux_raid_member                localhost.localdomain:2 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md2 ext4              /backup
    ├─sdc7  linux_raid_member                localhost.localdomain:3 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md3 ext4              /var/lib/mysql
    ├─sdc8  linux_raid_member                localhost.localdomain:4 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
     └─md4 ext4              /home
    └─sdc9  linux_raid_member                localhost.localdomain:5 a19d880f-05fc-4d3b-a006-743f0f84911e Linux RAID
      └─md5 ext4              /var/samba
    

    As I understand I have to clone the following 9 partitions:

    /dev/sdc1 — «BIOS boot partition» for Legacy Boot
    /dev/sdc2 — /boot
    /dev/sdc — swap partition
    /dev/md0 — /
    /dev/md1 — /var/log
    /dev/md2 — /backup
    /dev/md3 — /var/lib/mysql
    /dev/md4 — /home
    /dev/md5 — /var/samba

    And here is how Clonezilla detects my partitions:

    So the question is: should I manually create all these partitions on the destination virtual machine in advance (9 partitions on one disk) and then clone the data partition by partition?

    Could you please advise on the correct way to proceed with minimum manual intervation?

    Thank you very much!

     

    Last edit: The_Immortal 2025-03-31
  • Steven Shiau

    Steven Shiau - 2025-04-08

    Clonezilla does not support RAID well. Hence you have to deal with the RAID device manually.

    Steven

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.