How can I resize the root partition on a Raspberry Pi 3 B+

asked 2018-06-14 17:10:48 -0500

nat_g gravatar image

I am using a 32 GB micro SD card and I tried the following instructions:

Resize after initial-setup

The other mechanism for doing it is once you've booted the Raspberry Pi and completed the initial setup to create accounts.

enlarge the 4th partition (this example uses mmcblk0)

growpart /dev/mmcblk0 4

grow the fileystem to fill the available space

resize2fs /dev/mmcblk0p4

resize root partition for the server image (which uses xfs)

xfs_growfs -d /

The first command worked, but commands 2 and 3 above fail with the resize2fs one failing with "Device or resource busy while trying to open /dev/mmcblk0p3. Couldn't find valid filesystem superblock. The xfs_growfs fails with error: data size unchanged, skipping. I understand that the 3rd command needs the 2nd to succeed to be able to work. In my case it's partition 3 instead of 4. Now the results of ab "fdisk -l" command shows:

/dev/mmcblk0p3 with a 28.3 G size, but /dev/mapper/fedora-root is still only 5.1 GiB.

edit retag flag offensive close merge delete

Comments

Is it mounted?

hello gravatar imagehello ( 2018-06-14 22:38:34 -0500 )edit