I ran out of space?? Resizing the SD/root partition - Printable Version +- Forums (http://www.scratchpadgames.net/forums) +-- Forum: Main Forums (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=1) +--- Forum: Other SBC's (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=5) +--- Thread: I ran out of space?? Resizing the SD/root partition (/showthread.php?tid=7) |
I ran out of space?? Resizing the SD/root partition - Brian Beuken - 01-25-2018 The Raspberry is a good little unit, and one of the tasks it does for you automatically now is to resize the root partition so that you get the full size of your SD card. Sadly most other SBC's don't, and expect you to know how to do that.. But its actually not that obvious, especially if like me you are not a regular linix user. When you create a new image on your SD it does not start off with all the SD memory free, so you have to resize, if you find your SBC is resizing (a few do) then you won't need this, but I never could get a simple answer to the issue! Lucky I stumbled onto this blog post that helps to explain it all, you have to do this the 1st time you boot up a new SD image, if you write anything before you do that you will lose data. Here's the original post http://gleenders.blogspot.nl/2014/08/banana-pi-resizing-sd-card-root.html As its quite old, and the blogger does not seem to post any more, it might vanish so here is the bones of it again sudo fdisk /dev/mmcblk0 In fdisk: Press ‘p’ to print the partition table: Disk /dev/mmcblk0: 15.9 GB, 15931539456 bytes 4 heads, 16 sectors/track, 486192 cylinders, total 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 Disk identifier: 0x00084078 Device Boot Start End Blocks Id System /dev/mmcblk0p1 2048 124927 61440 83 Linux /dev/mmcblk0p2 124928 31116287 15495680 83 Linux the 124928 number may well be quite different on your SD, but take note of it, its this number that matters as its the start of the partition Press 'd' to delete a partition: Enter '2' to choose the second partition. Press 'n' to create a new partition: Enter 'p' to select primary as partition type. Partition number: enter to accept 2 as default partition number. First sector: enter to accept default. This should be that 124928 number of the number you took not of as the start Last sector: enter to accept default. Press 'w' to write the new partition table. Reboot to force the kernel to recognise the new partition table. sudo reboot After the system has come back up you still have to resize the partition. sudo resize2fs /dev/mmcblk0p2 when done you will now have the full size of your drive available to you to store data RE: I ran out of space?? Resizing the SD/root partition - Brian Beuken - 04-14-2019 Its now quite rare for a system to not resize its filesystem, (seems obvious to me it should have been done in the 1st versions of any OS...) So you are only likely to need this if you burn an old OS to an SD...if you suddenly run out of disk space...you should have resized..reburn the os and make sure this is the 1st thing you do before trying to update or install anything. RE: I ran out of space?? Resizing the SD/root partition - jomoengineer - 04-15-2019 Uh, I am not aware of a system that is no a Unix OS that will resize it's filesystem. Even then, it's hit and miss where or not it will resize the root partition using some third party tools. However, the NVIDIA Jetson Nano is supposed to resize the root filesystem to use up all of the SD card automatically at boot, but does not work 100% of the time. With the Raspberry Pi on the first boot of a fresh SD card, you would run 'raspi-config' and then select 'Advanced Options' and then 'Expand Filesystem' to resize the root partition and utilize the entire space of the SD card. Then reboot the Pi. There are manual ways of doing this, like what is required on a BeagleBone system, but one must be careful to not mess up the image otherwise a reburn of the SD card is required. RE: I ran out of space?? Resizing the SD/root partition - Brian Beuken - 04-15-2019 No thats the old way, Rpi and almost all current SBC distros, do an auto resize on the 1st boot, but tehre will be a few who don't RE: I ran out of space?? Resizing the SD/root partition - jomoengineer - 04-16-2019 I have yet to see a Raspberry Pi do an auto resize on the filesystem on first boot. The latest I tried was a RasPi 3 A+ and I still had to go the raspi-config route. I wonder if that is only available with the NOOB image and not Raspbian. RE: I ran out of space?? Resizing the SD/root partition - Brian Beuken - 04-16-2019 ?? resize hasn't been part of raspi-config for a year or 2 now...just double checked on an older 3B with jessie and it hasn't got it. I don't use noobs, so not sure if it has it, though it rather defeats the purpose of making things simple if it has. RE: I ran out of space?? Resizing the SD/root partition - Brian Beuken - 04-16-2019 are you using the latest version of raspbian? RE: I ran out of space?? Resizing the SD/root partition - jomoengineer - 04-16-2019 I don't have the April release, but its fairly recent. I'll have to give it another go and see what is happening. The Jetson Nano had an issue as well so perhaps there is something going on with the Linux version of Etcher. Thanks |