I need to duplicate SD for RPI, but if I use 32G SD than it might not fit on other 32G SD, so I'm forced to use 16G SD, but than I loose half of the SD size.
I followed the instruction in How can I resize my / (root) partition?
I was able to resize the partition to the full disk size but when I do
sudo resize2fs /dev/mmcblk0p3
I get:
resize2fs 1.43.3 (04-Sep-2016)
resize2fs: Device or resource busy while trying to open /dev/mmcblk0p3
Couldn't find valid filesystem superblock.
I wasn't able to continue from there, or to find any info about this issue.
I'm confused about how is it possible to change a fs while you are using it, I guess the answer is that you cannot, but the answer in How can I resize my / (root) partition? claim it should work.
The other thing I don't understand is how could it be so difficult to find info about resizing an img to fit the SD? it seems like a very basic actioned, as in my case for example.
This is the result of sudo fdisk /dev/mmcblk0
(before extending the partition):
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00013bb5
Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 * 1 125000 125000 61M c W95 FAT32 (LBA)
/dev/mmcblk0p2 125001 4882812 4757812 2.3G 83 Linux
/dev/mmcblk0p3 4884480 31116287 26231808 12.5G 83 Linux
This is the result of df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mmcblk0p2 2.2G 592M 1.5G 29% /imgpart
/dev/loop0 260M 260M 0 100% /static
overlay 13G 3.3G 8.3G 29% /
devtmpfs 475M 0 475M 0% /dev
tmpfs 486M 0 486M 0% /dev/shm
tmpfs 486M 8.6M 477M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 486M 0 486M 0% /sys/fs/cgroup
tmpfs 486M 32K 486M 1% /tmp
tmpfs 486M 0 486M 0% /var/spool/cups
tmpfs 20M 524K 20M 3% /var/log
tmpfs 486M 0 486M 0% /var/spool/cups/tmp
/dev/mmcblk0p1 61M 35M 26M 58% /boot
tmpfs 98M 0 98M 0% /run/user/1000
NOTE: I'm running Volumio, and the /
is mounted to partition 3 (I'm not sure why it show up as overlay
)