0

I am trying to clone my linux usb live persistence from 32GB drive to 64 GB drive. After I clone it, there are some unallocated space (32GB). I have done some research but I still cannot figure it out. Below are the things that I tried.

I booted from the old USB and use cfdisk to check the partition It says that there are unallocated free 32GB on my new USB drive so I used resize to resize the /dev/sdb3 from 20 GB to 54.3G as shown .

                              Disk: /dev/sdb
              Size: 57.3 GiB, 61505273856 bytes, 120127488 sectors
                       Label: dos, identifier: 0x0e390ebe

    Device      Boot     Start        End    Sectors   Size  Id Type
    /dev/sdb1   *           64    6279167    6279104     3G  17 Hidden HPFS/NTFS
    /dev/sdb2          6279168    6280575       1408   704K   1 FAT12
    /dev/sdb3          6281216  120127487  113846272  54.3G  83 Linux


when I use fdisk -l to check the partition it tells me it has 54.3GB in the partition


Device     Boot   Start       End   Sectors  Size Id Type
/dev/sdb1  *         64   6279167   6279104    3G 17 Hidden HPFS/NTFS
/dev/sdb2       6279168   6280575      1408  704K  1 FAT12
/dev/sdb3       6281216 120127487 113846272 54.3G 83 Linux

But when I use df-h it showed me that my /dev/sdb3 is still 26GB

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           785M   11M  775M   2% /run
/dev/sdb1       3.0G  3.0G     0 100% /run/live/persistence/sdb1
/dev/loop0      2.8G  2.8G     0 100% /run/live/rootfs/filesystem.squashfs
tmpfs           3.9G     0  3.9G   0% /run/live/overlay
/dev/sdb3        26G   18G  6.9G  72% /run/live/persistence/sdb3
overlay          26G   18G  6.9G  72% /
tmpfs           3.9G   48M  3.8G   2% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
tmpfs           3.9G  324K  3.9G   1% /tmp
tmpfs           785M   48K  785M   1% /run/user/0
/dev/sdb2       684K  670K   14K  98% /media/root/Kali Live

I also tried using GPartedbut it doesn't help. enter image description here

What can I do to extend the OS partition but not just the USB partition?

  • It looks like you increased the size of the partition, but not the file-system (that is in the partition). – ctrl-alt-delor Mar 16 at 19:02
  • Please paste text as text (not as pictures), it is easier to read that way (not just for blind people). And Why kali? Kali is hard to use (much like a swiss army chain-saw). kali has one purpose, and this is not it. You say you are new to Gnu/Linux, therefore kali is not for you. Chose an easier distro such as Debian. – ctrl-alt-delor Mar 16 at 19:02
  • @ctrl-alt-delor Thanks for your suggestions, I will improve next time! – Lau Chok Yip Mar 16 at 19:10
0

It sounds like you extended/increased the size of the partition but did not notify the filesystem that there was more space for it to use.

xfs_growfs or xfs_admin with the right flags should let you inform the filesystem that it can grow to fill the additional space.

This sort of thing can be tricky on a liveOS booting from a USB. It is often easier to install the liveOS fresh on the new device and copy your data over.

  • how can I copy my data over to new device? By using dd? – Lau Chok Yip Mar 16 at 19:20
  • @LauChokYip that is a different question. – ctrl-alt-delor Mar 17 at 13:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.