Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to expand system to fit 64gb sd card?
#1
So I just finished setup my RetrOrangPi nicely with all my preferences, settings and configurations on 32GB Sandisk class 10 memory card.

And I bought a new 64GB Sandisk class 10 micro sd recently. I wish to flash my 32GB image file created by win32diskimager to the new 64GB one. I don’t want to start everything from scratch.

Question is, is there any way I can expand the whole file system to fit the new 64GB card? So I can make full use of all extra storage.

Retropie has something to do in their raspi-config, but we don’t have it in RetrOrangePi.

So how to do that? Any idea? Thanks.

I am on OPi Lite.
Reply
#2
yes, it's possible. raspi-config contains a script with the fdisk command;

sudo fdisk /dev/mmcblk0
p (prints the partition table)
d (delete a partition)
if it's v4.2 (single partition), it will delete the first partition table, otherwise , choose the partition (1 or 2)
n (new partition)
p (primary)
enter (to confirm default 1)
8192 (instead of 2048 for the first sector)
enter (to confirm last sector)
w
sudo reboot

after reboot: sudo resize2fs /dev/mmcblk0p1

-----
LOG

pi@orangepipcplus:~$ sudo fdisk /dev/mmcblk0
[sudo] password for pi:

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): p
Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 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: 0x63de7d96

Device Boot Start End Sectors Size Id Type
/dev/mmcblk0p1 8192 30805119 30796928 14.7G 83 Linux

Command (m for help): d
Selected partition 1
Partition 1 has been deleted.

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

Created a new partition 1 of type 'Linux' and of size 14.9 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).

pi@orangepipcplus:~$ sudo resize2fs /dev/mmcblk0p1
resize2fs 1.42.13 (17-May-2015)
The filesystem is already 3849616 (4k) blocks long. Nothing to do!
Reply
#3
Thanks. It worked perfectly!!
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  [Solved] Broken system start (boot) laguna 10 777 10-03-2018, 07:13 PM
Last Post: laguna
  Contribution, fix of file extensions system psx laguna 0 180 09-25-2018, 07:34 AM
Last Post: laguna

Forum Jump:


Users browsing this thread: 2 Guest(s)