The original post: /r/ubuntu by /u/johnnybiggles on 2024-11-15 22:38:10.

I have a small form-factor computer system and I used an old mSATA SSD drive I pulled from a laptop with a case and USB wire for it that adapts/converts it to USB 3.0 drive. It’s been a pain to move this thing around with the drive attached to it all the time, so I want to move the Ubuntu 22 installation running from it to a micro SD card I can leave in it (I have a SanDisk microSDXC UHS-I card) I can leave in it. The built in drive is small and I’m dual booting it with LibreElec. How do I clone the whole OS to the SD card (and make it bootable) without having to reinstall everything?


UPDATE: I used ‘dd’ to do this and it seemed to work since I’m using the card only now. However, the card is 64GB whereas the USB drive was 32GB, so there is about 32GB of unallocated free space on the card that I need to merge with the filesystem partition that’s currently using about 14GB. I have time before it fills up but I’d like to extend this. GParted won’t let me since it’s the current OS mounted disk.

“The file system can not be resized while it is mounted read-only. Either unmount the file system or remount it read-write.”

Any advice?

The command I used was:

sudo dd if=/dev/sdb of=/dev/sdc bs=4M


UPDATE2: I was able to extend the partition when I connected it to another machine I have and used GParted there. Moved the card back to the small computer and it has the rest of the space now.