davinderpro post at 2019-4-20 22:25:56

Expand file system on DietPI (NAND) Orange Pi 2G IOT

Edited by davinderpro at 2019-4-21 00:31


I installed DietPI on NAND on Orange pi 2 IOT

How to expand the file system to take full 8 gb storage ?

Not able to install any software on it

fdisk -l


Disk /dev/mtdblock0: 2 MiB, 2097152 bytes, 4096 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 /dev/mtdblock1: 510 MiB, 534773760 bytes, 1044480 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



Default resizefs script does not work . It needs some modification
+ DEVICE=/dev/mmcblk0
+ PART=2
+ resize
+ awk {print $2}
+ grep /dev/mmcblk0p2
+ fdisk -l /dev/mmcblk0
fdisk: cannot open /dev/mmcblk0: No such file or directory
+ start=
+ echo

+ 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.

fdisk: cannot open /dev/mmcblk0: No such file or directory
+ set -e
+ partx -u /dev/mmcblk0
partx: stat failed /dev/mmcblk0: No such file or directory




here is the script :
#!/bin/sh

set -e

if [ "$(id -u)" -ne "0" ]; then
      echo "This script requires root."
      exit 1
fi

set -x

DEVICE="/dev/mmcblk0"
PART="2"

resize() {
      start=$(fdisk -l ${DEVICE}|grep ${DEVICE}p${PART}|awk '{print $2}')
      echo $start

      set +e
fdisk ${DEVICE} <<EOF
p
d
2
n
p
2
$start

w
EOF
      set -e

      partx -u ${DEVICE}
      resize2fs ${DEVICE}p${PART}
}

resize

echo "Done!"









Please help i followed this tutorial to flash Orange pi 2g IOT

https://surfero.blogspot.com/2017/09/orange-pi-iot-2g-flashear-memoria-nand.html


@surfero75



page: [1]
View full version: Expand file system on DietPI (NAND) Orange Pi 2G IOT