View: 20883|Reply: 14

Orange Pi One Plus & Lite2 - Guide to resize file system.

[Copy link]

4

threads

13

posts

116

credits

Registered member

Rank: 2

credits
116
Published in 2018-7-7 00:29:57 | Show all floors |Read mode
Edited by rollmeister at 2018-7-11 05:02

Provided Ubuntu Beta images do not automatically resize to grow the root (/) Linux partition. See below output below using fdisk and resize2fs commands.
In bold is where you have to type and press Enter. Italic text are notes/tips. If you have programs writing to disk while you do this, it may fail or corrupt filesystem. Works best on freshly image and after bootup. Annoying "unattended upgrades" daemon may be running immediately after first boot, use top command to see if any proccesses are active. I used sudo apt purge unattended-upgrades to uninstall as I rather have control and do updates myself with sudo apt update && sudo apt upgrade

If your user name is not in sudo group, you can use "su" command to change to root user default password is orangepi and proceed with resizing filesystem
You can add user to sudoers using usermod -aG sudo orangepi change "orangepi" to whatever username. This can only be done as root user.

# Start of filesystem resize task

miner@OrangePi:~$ sudo fdisk /dev/mmcblk0
[sudo] password for miner: (enter your user login password press Enter. user must be in sudo group see above.)

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

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): (press Enter)
First sector (2048-62521343, default 2048): 143360
Last sector, +sectors or +size{K,M,G,T,P} (143360-62521343, default 62521343): (press Enter)

Created a new partition 2 of type 'Linux' and of size 29.8 GiB.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy

The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).

# Reboot to apply changes, ready for resize2fs

miner@OrangePi:~$ sudo reboot

# Now grow/resize root filesystem. No reboot required.

miner@OrangePi:~$ sudo resize2fs /dev/mmcblk0p2
[sudo] password for miner: (enter your user login password press Enter. user must be in sudo group see above.)
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/mmcblk0p2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 2
The filesystem on /dev/mmcblk0p2 is now 7797248 (4k) blocks long.

Your filesystem should now use all available space on sd card.
*A note on SD Cards with fake capacity.
This is rampant with online vendors, selling cheap micro SD Cards. You probably will not get a replacement.
If you ask for a replacement, they say a new genuine card is sent out but don't and wait out the buyer protection period, but you should try a refund.
In such cases the micro SD Card is only 8gb in capacity, or less. You can still use the SD Card though.
Use h2testw (for windows) to find out the true capacity and on the "Last block..." step during above resize operation enter a smaller value e.g. trying for approx 8gb resize...
Last sector, +sectors or +size{K,M,G,T,P} (143360-62521343, default 62521343): 15000000 (and press Enter)
Published in 2025-1-19 20:57:25 | Show all floors
I will express this this is usually a an awesome posting on the superb human being, i'm just very happy to find the following.        https://designerpoolcoverskzn.co.za/
Published in 2025-1-21 14:47:28 | Show all floors
I might point out in which it is a a fantastic submit of your fantastic particular person, now i'm pleased to notice this kind of.        https://bwproductions.co.za/
Published in 2025-2-3 20:23:01 | Show all floors
Really good write-up, Appreciate it intended for giving That expertise. Excellently published document, but only if many blog writers made available identical higher level of information since you, the online world is a significantly better area. You need to thanks!        graphic design courses       

Address: SECOND FLOOR, E Block Rd, South Extension I, Block E, New Delhi, Delhi 110049. Phone: 093157 90731
Published in 2025-2-4 18:28:26 | Show all floors
The idea thinks wonderful you just read this sort of helpful along with exclusive content on the internet sites.        womens funny underwear
Published in 2025-2-6 19:15:30 | Show all floors
Used to do appreciate reading through content articles submitted on this website. They're amazing and it has lots of helpful info.        map grant
Published in 2025-2-15 18:45:16 | Show all floors
Being a Novice, I will be once and for all checking out on the web regarding posts which can be regarding assist with myself. Many thanks.        bride panties
Published in 2025-2-17 15:59:55 | Show all floors
Your blog has piqued a lot of real interest. I can see why since you have done such a good job of making it interesting. I appreciate your efforts very much.        Slot BigWin
Published in 2025-2-17 19:13:51 | Show all floors
I’m stirred along with the surpassing and additionally preachy list of you ought to produce such smaller timing.        Car unlocks
Published in 2025-2-18 21:25:52 | Show all floors
Very informative post! There is a lot of information here that can help any business get started with a successful social networking campaign.        TW88
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list