PINE64
When & How to use resize_rootfs.sh? - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: General (https://forum.pine64.org/forumdisplay.php?fid=1)
+--- Forum: Getting Started (https://forum.pine64.org/forumdisplay.php?fid=21)
+--- Thread: When & How to use resize_rootfs.sh? (/showthread.php?tid=1849)



When & How to use resize_rootfs.sh? - jesse1234 - 07-25-2016

Quote:
  • Execute resize_rootfs.sh script to resize the root partition in order to fully utilize the SD Card

Well I have the Debian Jessie OS up and running but I am using a 32GB SD card that only sees according to the Disk Usage Analyzer only 7.5 GB.

I tried using the terminal to execute the script but I am not sure where in the file system it is located!?

When & How to use resize_rootfs.sh?

Jesse  Huh


RE: When & How to use resize_rootfs.sh? - Terra854 - 07-25-2016

(07-25-2016, 01:25 AM)jesse1234 Wrote:
Quote:
  • Execute resize_rootfs.sh script to resize the root partition in order to fully utilize the SD Card

Well I have the Debian Jessie OS up and running but I am using a 32GB SD card that only sees according to the Disk Usage Analyzer only 7.5 GB.

I tried using the terminal to execute the script but I am not sure where in the file system it is located!?

When & How to use resize_rootfs.sh?

Jesse  Huh

Just type "sudo resize_rootfs.sh" into the terminal and it will resize the filesystem for you.

If the terminal says that it can't find the script (in rare cases), type "sudo /usr/local/sbin/resize_rootfs.sh" instead.


RE: When & How to use resize_rootfs.sh? - jesse1234 - 07-25-2016

Thanks Terra

Well I did as suggested. I went back and pulled up the command histroy and it actually did something. Below are the results but after rebooting, the Disk Usage Analyzer still shows 7.5 GB.

Code:
debian@pine64:~$ sudo usr/local/sbin/resize_rootfs.sh
[sudo] password for debian:
sudo: usr/local/sbin/resize_rootfs.sh: command not found
debian@pine64:~$ sudo resize_rootfs.sh
+ DEVICE=/dev/mmcblk0
+ PART=2
+ resize
+ fdisk -l /dev/mmcblk0
+ grep /dev/mmcblk0p2
+ awk {print $2}
+ start=143360
+ echo 143360
143360
+ set +e
+ fdisk /dev/mmcblk0

Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): Disk /dev/mmcblk0: 29.7 GiB, 31914983424 bytes, 62333952 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: 0xa2427f8e

Device         Boot  Start      End  Sectors Size Id Type
/dev/mmcblk0p1       40960   143359   102400  50M  e W95 FAT16 (LBA)
/dev/mmcblk0p2      143360 14884863 14741504   7G 83 Linux


Command (m for help): Partition number (1,2, default 2):
Partition 2 has been deleted.

Command (m for help): Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): Partition number (2-4, default 2): First sector (2048-62333951, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (143360-62333951, default 62333951): Last sector, +sectors or +size{K,M,G,T,P} (143360-62333951, default 62333951):
Do you really want to quit? + set -e
+ partx -u /dev/mmcblk0
+ resize2fs /dev/mmcblk0p2
resize2fs 1.43 (17-May-2016)
The filesystem is already 1842688 (4k) blocks long.  Nothing to do!

+ echo Done!
Done!
debian@pine64:~$

Any suggestions at this time would be most appreciative.

Jesse


RE: When & How to use resize_rootfs.sh? - DonFL - 07-25-2016

Use gparted. I found it to make a lot more sense when I used it, as opposed to depending on a script.


RE: When & How to use resize_rootfs.sh? - jesse1234 - 07-25-2016

Thanks DonFL

Odd that I received your post right after I had used the GParted app. Since this OS  is a GNOME2 deadbeat and there has been a lot of renaming of applications or maybe the other way around!? Anyway using the GParted app, I found the rootfs partition and was allowed to move and/or resize it which eliminated the other partition successfully maxing out the rootfs partition. Using the Disk Usage Analyzer confirms this.

Jesse

Also another unallocated partition exisited although small, 20 MiB, yet it was set at the beginning of the SD Card partition set. I had decided not to touch this one. Curious does anyone know what this is???

Jesse


RE: When & How to use resize_rootfs.sh? - Terra854 - 07-25-2016

(07-25-2016, 03:16 PM)jesse1234 Wrote: Also another unallocated partition exisited although small, 20 MiB, yet it was set at the beginning of the SD Card partition set. I had decided not to touch this one. Curious does anyone know what this is???

Don't touch that 20 MiB of "free space". It contains boot0, uboot and other boot files, which is critical for booting your linux system.