please choosego to mobile | Continue to access the PC version
View: 8194|Reply: 0

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

[Copy link]

1

threads

4

posts

22

credits

Novice

Rank: 1

credits
22
Published in 2019-4-20 22:25:56 | Show all floors |Read mode
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


  1. Disk /dev/mtdblock0: 2 MiB, 2097152 bytes, 4096 sectors
  2. Units: sectors of 1 * 512 = 512 bytes
  3. Sector size (logical/physical): 512 bytes / 512 bytes
  4. I/O size (minimum/optimal): 512 bytes / 512 bytes
  5. Disk /dev/mtdblock1: 510 MiB, 534773760 bytes, 1044480 sectors
  6. Units: sectors of 1 * 512 = 512 bytes
  7. Sector size (logical/physical): 512 bytes / 512 bytes
  8. I/O size (minimum/optimal): 512 bytes / 512 bytes
Copy code



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

  10. + set +e
  11. + fdisk /dev/mmcblk0

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

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

Copy code



here is the script :
  1. #!/bin/sh

  2. set -e

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

  7. set -x

  8. DEVICE="/dev/mmcblk0"
  9. PART="2"

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

  13.         set +e
  14.   fdisk ${DEVICE} <<EOF
  15. p
  16. d
  17. 2
  18. n
  19. p
  20. 2
  21. $start

  22. w
  23. EOF
  24.         set -e

  25.         partx -u ${DEVICE}
  26.         resize2fs ${DEVICE}p${PART}
  27. }

  28. resize

  29. echo "Done!"
Copy code









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



You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list