Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[OT] Help with clonezilla-live: LUKS/LVM2 image backup without partclone.dd

464 views
Skip to first unread message

l0f...@tuta.io

unread,
Apr 14, 2021, 2:00:05 PM4/14/21
to
Hi,

Do some of you use clonezilla for your backups, especially with a LVM2/LUKS configuration please?

I've written some days ago to the clonezilla-live mailing-list but I'm not sure I'll ever get answers considering the very very low traffic on it. So maybe I'll be more lucky here between Debianists :)

Here is the partition configuration on my SSD:

NAME                       FSTYPE      LABEL     MOUNTPOINT                     SIZE
nvme0n1                                                                         477G
├─nvme0n1p1                vfat                  /boot/efi                      477M
├─nvme0n1p2                                                                      16M
├─nvme0n1p3                ext4        boot      /boot                          477M
├─nvme0n1p4                ntfs        WinRE_DRV                               1000M
└─nvme0n1p5                crypto_LUKS                                        474,8G
  └─nvme0n1p5_crypt        LVM2_member                                        474,8G
    ├─myLvmGroup-myLvmSwap swap                  [SWAP]                        14,9G
    ├─myLvmGroup-myLvmVar  ext4        var       /var                          18,6G
    ├─myLvmGroup-myLvmRoot ext4        root      /                             74,5G
    └─myLvmGroup-myLvmHome ext4        home      /home                          326G

I want to create a clonezilla image of everything on an external drive partition.

So I boot on a clonezilla-live installed on a USB stick, open a shell in order to open my LUKS container (at this stage myLvmGroup is recognized and deployed), start clonezilla and use the ncurses interface.

Partitions like nvme0n1p{1,3,4} are backupped cleverly with `partclone.{vfat,ext4,ntfs}` respectively. Good.

`partclone.dd` is used for nvme0n1p2 (no big deal, it's an Ms reserved partition). OK.

However, `partclone.dd` is used as well with nvme0n1p5. Not good. This is not very handy (it's time-consuming and produces a large file as `dd` doesn't understand the underlying fs with the empty space).

I think this is due to the fact that my LVM is shutdowned in clonezilla before the backup starts, as indicated in my logs:

Clonezilla image dir: /home/partimag
Shutting down the Logical Volume Manager
  Shutting Down logical volume: /dev/myLvmGroup/myLvmHome
  Shutting Down logical volume: /dev/myLvmGroup/myLvmRoot
  Shutting Down logical volume: /dev/myLvmGroup/myLvmSwap
  Shutting Down logical volume: /dev/myLvmGroup/myLvmVar
  Shutting Down volume group: myLvmGroup
Finished Shutting down the Logical Volume Manager

* Do you know why there is this behavior please?

* Am I supposed to stay in shell mode and use `partclone` directly on each of my logical volumes? Like the following maybe:
`partclone.ext4 -z 10485760 -N -L /home/partimg/partclone.log -c -s /dev/mapper/myLvmGroup-myLvmRoot --output - | zstdmt -c -3 --rsyncable | split -a 2 -b 4096MB - /home/partimg/myLvmGroup-myLvmRoot.ext4-ptcl-img.zst. 2> /home/partimg/split_error.log`?

* I haven't done it so far but do you think I can use the following command directly
`/usr/sbin/ocs-sr -q2 -c -j2 -z9p -i 4096 -fsck -enc -p choose savedisk fulldisk_encrypted_img nvme0n1`? Or will my LVM be shutdowned as well?

* Do you have any advice to share?

Thank you in advance :)

Best regards,
l0f4r0

didier gaumet

unread,
Apr 14, 2021, 3:00:04 PM4/14/21
to

>
Hello,

Disclaimer: I have never used Clonezilla nor LUKS

"Many File systems are supported: (1) ext2, ext3, ext4, reiserfs,
reiser4, xfs, jfs, btrfs, f2fs and nilfs2 of GNU/Linux, (2) FAT12,
FAT16, FAT32, NTFS of MS Windows, (3) HFS+ of Mac OS, (4) UFS of
FreeBSD, NetBSD, and OpenBSD, (5) minix of Minix, and (6) VMFS3 and
VMFS5 of VMWare ESX. Therefore you can clone GNU/Linux, MS windows,
Intel-based Mac OS, FreeBSD, NetBSD, OpenBSD, Minix, VMWare ESX and
Chrome OS/Chromium OS, no matter it's 32-bit (x86) or 64-bit (x86-64)
OS. For these file systems, only used blocks in partition are saved and
restored by Partclone. For unsupported file system, sector-to-sector
copy is done by dd in Clonezilla."

So it seems to me appropriate that dd is used as you want an image of a
whole disk?

l0f...@tuta.io

unread,
Apr 14, 2021, 4:50:04 PM4/14/21
to
Hi Didier,

Thanks for your answer.

14 avr. 2021, 20:50 de didier...@gmail.com:

> So it seems to me appropriate that dd is used as you want an image of a whole disk?
>
Whole disk here doesn't mean 1 image file.

Actually, after running clonezilla I get numerous files:

nvme0n1p1.vfat-ptcl-img.zst.aa
nvme0n1p2.dd-ptcl-img.zst.aa
nvme0n1p3.ext4-ptcl-img.zst.aa
nvme0n1p4.ntfs-ptcl-img.zst.aa
nvme0n1p5.dd-ptcl-img.zst.aa
nvme0n1p5.dd-ptcl-img.zst.ab
nvme0n1p5.dd-ptcl-img.zst.ac
[...]

Partitions are processed one by one by clonezilla.
That's why I said that partitions like nvme0n1p{1,3,4} are backupped with `partclone.{vfat,ext4,ntfs}` respectively, while nvme0n1p{2,5} are backupped with `partclone.dd`.

Logs show that each step has run successfully:

Finished saving /dev/nvme0n1p1 as /tmp/ecryptfs_mnt.VDFrH7/nvme0n1p1.vfat-ptcl-img.zst
Finished saving /dev/nvme0n1p2 as /tmp/ecryptfs_mnt.VDFrH7/nvme0n1p2.dd-ptcl-img.zst
Finished saving /dev/nvme0n1p3 as /tmp/ecryptfs_mnt.VDFrH7/nvme0n1p3.ext4-ptcl-img.zst
Finished saving /dev/nvme0n1p4 as /tmp/ecryptfs_mnt.VDFrH7/nvme0n1p4.ntfs-ptcl-img.zst
Finished saving /dev/nvme0n1p5 as /tmp/ecryptfs_mnt.VDFrH7/nvme0n1p5.dd-ptcl-img.zst

Best regards,
l0f4r0

didier gaumet

unread,
Apr 15, 2021, 4:00:05 AM4/15/21
to

Ouch! both the two replies I made yesterday on this list were too rough
and I should have read the original posts more carefully.
Sorry for that and not being able to propose a solution :-)
0 new messages