0

I would like to clone a whole linux OS from the harddrive to an external USB stick. However, I don't want to clone all the unused part of the harddrive, only the used part. The partitions on the harddrive look like this (lsblk)

sda
- sda1 512M /boot/efi
- sda2 1K
- sda5 223,1G /

With df -H:

/dev/sda5 235G 14G 210G /
/dev/sda1 536M 6,4M 530M /boot/efi

As you can see, only 14G are occupied so there is no reason that this whole OS doesn't fit on my 32GB USB-Stick.

The question now is - how can I do this as user friendly as possible? I tried Clonezilla and gave up after 4h of not being able to read my external USB stick and / or not being able to clone the data to another computer.

3
  • what's the filesystem type? ext4?
    – golimar
    Commented May 11, 2023 at 13:39
  • 1
    For cloning the amou8nt of unused space within a partition is immaterial. And you can only clone to a drive of the same size or bigger. If you want to do what you described then first you must resize, shrink, sda5 so that the whole space of all the required partitions does NOT exceed the size of the target drive. It's that simple. Commented May 11, 2023 at 16:58
  • 2
    It sounds like you don’t want to clone the disk but to make a copy of the used file system. Best bet is a tool like rsync with appropriate exclusions so you don’t try to copy /dev, /proc, /sys, etc.
    – doneal24
    Commented May 11, 2023 at 17:54

0

You must log in to answer this question.

Browse other questions tagged .