How to expand the file system manually?

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
big4570

How to expand the file system manually?

Post by big4570 »

I've been running Owncloud and it was extremely easy to setup through dietpi. I'm expanding my storage to a 128g card (currently on a 32g) So I ripped my SD card image to transfer on the new card. My problem is I don't seem the ability to expand the file system like in the raspi-config script on a stock image of raspbian. I was wondering how to expand the file system using dietpi?
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: How to expand the file system manually?

Post by k-plan »

big4570 wrote:I was wondering how to expand the file system using dietpi?
Manual like:

Code: Select all

root@OrangePi-ONE:~# 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.


Command (m for help): p
Disk /dev/mmcblk0: 7,4 GiB, 7969177600 bytes, 15564800 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: 0x0000b6e5

Device         Boot  Start      End  Sectors  Size Id Type
/dev/mmcblk0p1        2048   133119   131072   64M  e W95 FAT16 (LBA)
/dev/mmcblk0p2      133120 15564799 15431680  7,4G 83 Linux


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): 2
First sector (133120-15564799, default 133120):
Last sector, +sectors or +size{K,M,G,T,P} (133120-15564799, default 15564799):

Created a new partition 2 of type 'Linux' and of size 7,4 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.: Das Gerät oder die Ressource ist belegt

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

root@OrangePi-ONE:~# partprobe

root@OrangePi-ONE:~# resize2fs /dev/mmcblk0p2
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 1928960 (4k) blocks long.  Nothing to do!

reboot

If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
big4570

Re: How to expand the file system manually?

Post by big4570 »

Thanks for that, is there any script available within diet-pi that simplifys the process?
User avatar
k-plan
Posts: 416
Joined: Sun Feb 28, 2016 5:28 pm

Re: How to expand the file system manually?

Post by k-plan »

Yes, but why? You ask for manual resize.....

https://github.com/Fourdee/DietPi/blob/ ... i/boot#L90

... but it only run once at first boot up and it is the same.

Have you tried to do it manually?
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.
Post Reply