Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 424|Reply: 0

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

[Copy link]

1

Threads

4

Posts

20

Credits

Novice

Rank: 1

Credits
20
Post time 2019-4-20 22:25:56 | Show all posts |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 the 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 the 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 the 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 have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-8-19 05:30 GMT+8 , Processed in 0.023948 second(s), 23 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list