PINE64
resize root partition to max available space SD card can provide - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PINE A64(+) (https://forum.pine64.org/forumdisplay.php?fid=4)
+--- Forum: Linux on Pine A64(+) (https://forum.pine64.org/forumdisplay.php?fid=6)
+---- Forum: Debian (https://forum.pine64.org/forumdisplay.php?fid=24)
+---- Thread: resize root partition to max available space SD card can provide (/showthread.php?tid=2771)

Pages: 1 2


resize root partition to max available space SD card can provide - bilylilyli - 11-15-2016

After booting, I excute the following commands:

sudo -i
/usr/local/sbin/pine64_update_uboot.sh
/usr/local/sbin/pine64_update_kernel.sh
resize_rootfs.sh
reboot

My sd card(16 GB) does not resize. It only have 50MB to be used. How get I actually resize my sd card? I just burn the debian image to my sd card. 


Did I do something wrong? Thank you for any help!


RE: resize root partition to max available space SD card can provide - pfeerick - 11-15-2016

No, those are the right commands. What does df -h and sudo fdisk -l report?


RE: resize root partition to max available space SD card can provide - dkryder - 11-16-2016

i'm thinking you would need to state directory path for the resize script also, or be in that directory.


RE: resize root partition to max available space SD card can provide - MarkHaysHarris777 - 11-16-2016

hi, the resize_rootfs.sh should have a path specified also; however, the resize_rootfs.sh may not work.

The SD card may be resized with gparted from another gnu+linux machine.


RE: resize root partition to max available space SD card can provide - pfeerick - 11-16-2016

(11-16-2016, 01:13 AM)MarkHaysHarris777 Wrote: hi, the resize_rootfs.sh should have a path specified also;  however,  the resize_rootfs.sh may not work.

The SD card may be resized with gparted from another gnu+linux machine.

If you mean internally to the script - yes. If you mean as a parameter, then no. Otherwise both longlseeps and Lenney's instructions for the last six months are wrong, and the script isn't doing what it says it does! I don't think so! :-P You simply run resize_rootfs.sh without any special parameters or change directories needed - only sudo/root privileges else fdisk will fail. 

I think since you're saying you've only just written the debian image to a microSD, that either this could be an older image where resize_rootfs.sh was broken, or more likely either the microSD is faulty/fake or the partition table has been corrupted. You will get a better some idea of that if you run gparted or fdisk on another linux machine (you can live-boot linux if you don't have it installed on another box).


RE: resize root partition to max available space SD card can provide - Armbian User - 11-16-2016

(11-15-2016, 05:16 PM)bilylilyli Wrote: Did I do something wrong?

Maybe just using outdated/buggy OS images. The good ones automatically resize the partition for you, the best ones don't use the whole capacity so doing backups and restoring them to a different card later will not fail (ran into this multiple times: 2 16 GB cards differ by a few sectors and restoring an SD card backup image then fails)


RE: resize root partition to max available space SD card can provide - MarkHaysHarris777 - 11-16-2016

(11-16-2016, 03:42 AM)pfeerick Wrote: Otherwise both longlseeps and Lenney's instructions for the last six months are wrong, and the script isn't doing what it says it does! I don't think so!

Yes, actually, your assumption is not correct;  the script DOES NOT ALWAYS do what it says it does, and it often does not work.  True Story.   ( and a known and documented problem )   They thought it was fixed, but, nope.


RE: resize root partition to max available space SD card can provide - bilylilyli - 11-16-2016

(11-16-2016, 01:13 AM)MarkHaysHarris777 Wrote: hi, the resize_rootfs.sh should have a path specified also;  however,  the resize_rootfs.sh may not work.

The SD card may be resized with gparted from another gnu+linux machine.

hi, how can I specify the path when I run the resize_rootfs.sh?

(11-15-2016, 08:35 PM)pfeerick Wrote: No, those are the right commands. What does df -h and sudo fdisk -l report?

hi, I run those two command, and I attach the resuld. The first picture is for df -h and the second one is for fdisk -l.


RE: resize root partition to max available space SD card can provide - Armbian User - 11-16-2016

(11-15-2016, 05:16 PM)bilylilyli Wrote: It only have 50MB to be used. How get I actually resize my sd card?

From your first post it was obvious that everything happened already, you are only looking at the wrong partition most probably from the wrong perspective (your Windows PC that can't cope with ext4) Smile

(11-16-2016, 01:13 AM)MarkHaysHarris777 Wrote: hi, the resize_rootfs.sh should have a path specified also

Strange, almost all the time you answer user questions polite, friendly and wrong. Why do you do this especially as moderator users might trust blindly?


RE: resize root partition to max available space SD card can provide - pfeerick - 11-16-2016

(11-16-2016, 12:37 PM)bilylilyli Wrote: hi, how can I specify the path when I run the resize_rootfs.sh?

hi, I run those two command, and I attach the resuld. The first picture is for df -h and the second one is for fdisk -l.

When you look at the code for resize_rootfs.sh that I linked to earlier, it's pretty obvious that resize_rootfs.sh doesn't accept any parameters - it is hard-coded at lines 11 & 12 to resize "/dev/mmcblk0p2" - which is the second partition on your microSD card.

If you look back that df -h (or the fdisk) listing, you can see that you have /dev/mmcblk0p1 (50MB in size) and /dev/mmcblk0p2 (7GB in size). /dev/mmcblk0p1 is a boot partition, and if you look at the microsd on a Windows machine, that is all you will be able to see (without installing extra drivers / software). /dev/mmcblk0p2 is the actual data partition for linux, and that is the one that should be resized when you run resize_rootfs.sh. The problem now is in knowing why the resize has failed, as you said this is on a 16GB microSD, and it hasn't been resized up to use the full 16GB. Do you get any errors or output from resize_rootfs.sh when you run it again (make sure you're running as root).

Can you give the link to where you got the image from or which version it was, - as I indicated earlier, there was a older image that had a bug in resize_rootfs but that was fixed about three-four months ago, so I just want to make sure that image is not still linked as a current image somewhere.