[HOWTO] Resize Your Linux Partition LIVE

Moderators: meveric, mdrjr, odroid

[HOWTO] Resize Your Linux Partition LIVE

Unread postby mdrjr » Mon Dec 09, 2013 5:48 am

This guide will teach you how to properly resize your Linux install partition without anything but the OS booted on the ODROID Board.

This guide works for eMMC or SDCard.
Make sure that you have only the eMMC or SD connected at this time.

Download the script attached on this thread

and type:
Code: Select all
chmod +x resize.sh
sudo ./resize.sh


You'll see the following output:
Code: Select all
root@odroid:~# sudo ./resize.sh
Found the start point of mmcblk0p2: 266240
Ok, Partition resized, please reboot now
Once the reboot is completed please run this script again


reboot the board now, just type sudo reboot

Once the boot is done, run the script again!
Code: Select all
root@odroid:~# sudo ./resize.sh
Activating the new size
resize2fs 1.42.5 (29-Jul-2012)
Done!
Enjoy your new space!


You are done now, your / partition is using the entire space of the disk :)
Attachments
resize.sh
Resize v1
(600 Bytes) Downloaded 9137 times
mdrjr
Site Admin
 
Posts: 11619
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [HOWTO] Resize Your Linux Partition LIVE (X/X2/U2)

Unread postby memeka » Mon Dec 09, 2013 5:59 am

Finally :) I've been doing this forever.
btw, it works with the 3.0 kernel, and for the XU as well (as long as you have kernel support, and there are big chances there is kernel support for ext3 and ext4).
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [HOWTO] Resize Your Linux Partition LIVE (X/X2/U2)

Unread postby mdrjr » Mon Dec 09, 2013 6:06 am

memeka wrote:Finally :) I've been doing this forever.
btw, it works with the 3.0 kernel, and for the XU as well (as long as you have kernel support, and there are big chances there is kernel support for ext3 and ext4).


And why you never posted here explaining how to use?

I've been doing this since the first boot of 3.8 on my -X.

Edit: Yes, it works on XU too. So.. all odroid's should be covered now.
mdrjr
Site Admin
 
Posts: 11619
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby memeka » Mon Dec 09, 2013 7:10 am

We were talking about it here: viewtopic.php?f=9&t=1239&start=40#p10406 :)
I was complaining to neagix that switching to ext2 for rootfs you cannot to this, since only ext3 and ext4 were supported in the kernel :)
User avatar
memeka
 
Posts: 3529
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby osterluk » Mon Dec 09, 2013 11:18 am

Nice. This will help a lot of people.
Thanks
osterluk
 
Posts: 311
Joined: Sun Feb 24, 2013 2:07 am
languages_spoken: English
ODROIDs: Odroid-U2

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby wmseward » Thu Dec 26, 2013 7:37 am

Nice simple script. Code review is easy!

Now I want to write a script.

Thanx!
wmseward
 
Posts: 3
Joined: Wed Dec 25, 2013 11:41 am
languages_spoken: english
ODROIDs: Soon to get U3(s)!

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby TSC » Fri Jun 13, 2014 3:30 am

I get:
Code: Select all
open: No such file or directory while opening /dev/mmcblk0p2
.

Any idea how to resolver this? I have Lubuntu 13.10 CodeMonkey U2 image installed in the eMMC through win32diskimager. Image runs good in U3 and I can open the content in Windows. But no luck on mounting this image in Ubuntu 13.10 (installed in my laptop). Need the partition resized since I have a 16gb eMMC and can only use 8GB of the image above.

Running dmesg on the cmd line gives me:

Code: Select all
[  604.675367] mmc0: BKOPS_EN bit is not set
[  604.678521] mmc0: error -22 whilst initialising MMC card


gparted doesn't give me any partition at all besides the one /dev/sda1, /dev/sdb/ and /dev/sdc/.

Thank you! Any help would be great!

Best regards
Last edited by TSC on Fri Jun 13, 2014 3:40 am, edited 1 time in total.
TSC
 
Posts: 41
Joined: Sat May 11, 2013 9:51 pm
languages_spoken: english, portuguese
ODROIDs: ODROID-X2 / U3

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby mdrjr » Fri Jun 13, 2014 3:33 am

Do you have a microsd at the same time ? If so, remove it.. resize and it will work..
mdrjr
Site Admin
 
Posts: 11619
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby TSC » Fri Jun 13, 2014 6:38 am

mdrjr wrote:Do you have a microsd at the same time ? If so, remove it.. resize and it will work..


No microsd inserted. Just the emmc connected to the sd card reader of the laptop through the emmc-to-usd adaptor. This adaptor is also inserted in a usd-to-sd adaptor.
TSC
 
Posts: 41
Joined: Sat May 11, 2013 9:51 pm
languages_spoken: english, portuguese
ODROIDs: ODROID-X2 / U3

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby mdrjr » Fri Jun 13, 2014 6:43 am

Ugh. This script is made to be executed on the board with the OS running not on your PC
mdrjr
Site Admin
 
Posts: 11619
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby TSC » Fri Jun 13, 2014 6:50 am

mdrjr wrote:Ugh. This script is made to be executed on the board with the OS running not on your PC

Lol a sério? Desculpa nao tinha percebido! Vou experimentar e depois aviso. Saudações de Portugal ;)
TSC
 
Posts: 41
Joined: Sat May 11, 2013 9:51 pm
languages_spoken: english, portuguese
ODROIDs: ODROID-X2 / U3

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby labsin » Thu Feb 19, 2015 8:02 am

This script is a bit dangerous. I have a setup with only one partition so it doesn't find the start byte, so the it just enters 0 when asked for the start byte.
It needs some checks etc.
Might be best to just post the steps.
labsin
 
Posts: 5
Joined: Thu Feb 19, 2015 7:50 am
languages_spoken: english
ODROIDs: C1

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby rakekniven » Sat Feb 21, 2015 3:22 am

My C1 does not want to resize.
Took the image from 5th of feb and wrote it on my 32 GB SD card using the Windows tool.
Device is booting up fine and everything is good so far.

Code: Select all
:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/mmcblk0p2  4.3G  4.0G  184M  96% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev            420M  4.0K  420M   1% /dev
tmpfs           425M  4.0K  425M   1% /tmp
tmpfs            85M  2.6M   83M   3% /run
none            5.0M     0  5.0M   0% /run/lock
none            425M   76K  425M   1% /run/shm
none            100M   24K  100M   1% /run/user
/dev/mmcblk0p1  129M  7.2M  122M   6% /media/boot


So I took the script "resize.sh" and started it.
Output
Code: Select all
:~# ./resize.sh
Found the start point of mmcblk0p2: 266240
Ok, Partition resized, please reboot now
Once the reboot is completed please run this script again

So I rebooted it and run it again.

Output:
Code: Select all
:~$ ./resize.sh
Activating the new size
resize2fs 1.42.9 (4-Feb-2014)
resize2fs: No space left on device While checking for on-line resizing support
Done!
Enjoy your new space!


fstab info:
Code: Select all
:~$ more /etc/fstab
# UNCONFIGURED FSTAB FOR BASE SYSTEM

UUID=e139ce78-9841-40fe-8823-96a304a09859   /   ext4   errors=remount-ro,noatime,nodiratime      0 1
UUID=6E35-5356   /media/boot   vfat   defaults,rw,owner,flush,umask=000   0 0
tmpfs      /tmp   tmpfs   nodev,nosuid,mode=1777         0 0


Hmmh, have not found any useful hints.

Anyone?
rakekniven
 
Posts: 3
Joined: Fri Feb 20, 2015 4:49 pm
languages_spoken: english, german
ODROIDs: C1

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby mdrjr » Sat Feb 21, 2015 3:26 am

Use ODROID Utility to do that.
mdrjr
Site Admin
 
Posts: 11619
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby rakekniven » Sat Feb 21, 2015 8:54 pm

Done that in the meantime. Works pretty well.
Thx.
rakekniven
 
Posts: 3
Joined: Fri Feb 20, 2015 4:49 pm
languages_spoken: english, german
ODROIDs: C1

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby labsin » Sun Feb 22, 2015 4:51 am

loboris also has a nice fs_resize script in his Ubuntu/Debian distro's that deals with 1 partition, does some echo'ing and adds a init script for resize2fs on reboot.

I attached it here. But it's not mine, it's from http://forum.odroid.com/viewtopic.php?f=112&t=8075
Attachments
fs_resize.sh
(2.3 KiB) Downloaded 478 times
labsin
 
Posts: 5
Joined: Thu Feb 19, 2015 7:50 am
languages_spoken: english
ODROIDs: C1

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby weyb » Fri Mar 27, 2015 8:18 pm

mdrjr wrote:Use ODROID Utility to do that.


for the newbies like me : it's on the Ubuntu desktop !
weyb
 
Posts: 30
Joined: Fri Mar 20, 2015 9:28 pm
Location: Grasse (06 France)
languages_spoken: english
ODROIDs: C1

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby atodea » Sat May 30, 2015 8:22 pm

Thank you.
It works like a charm!
atodea
 
Posts: 3
Joined: Sat Mar 08, 2014 6:30 am
languages_spoken: english

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby Cerin » Mon Jun 01, 2015 11:26 am

I used the "Odroid Utility" to resize the partition on my C1. It does nothing. Running `df -H` still shows that /dev/mmcblk0p2 is still only 4.6G even though I'm using a 32GB card.

How do you expand the root partition on a C1?
Cerin
 
Posts: 2
Joined: Mon Jun 01, 2015 10:32 am
languages_spoken: english
ODROIDs: C1

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby mdrjr » Mon Jun 01, 2015 11:35 am

Cerin wrote:I used the "Odroid Utility" to resize the partition on my C1. It does nothing. Running `df -H` still shows that /dev/mmcblk0p2 is still only 4.6G even though I'm using a 32GB card.

How do you expand the root partition on a C1?


Start by posting on the correct place and attaching the LOG on /root.

Did you rebooted after the resize?
mdrjr
Site Admin
 
Posts: 11619
Joined: Fri Feb 22, 2013 11:34 pm
Location: Brazil
languages_spoken: english, portuguese
ODROIDs: -

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby ceVoIX » Mon Aug 31, 2015 7:27 pm

Hi,
I am a linux beginner, in which folder i have to grab the resize.sh file?
ceVoIX
 
Posts: 7
Joined: Tue Aug 25, 2015 10:23 pm
languages_spoken: german, english
ODROIDs: Odroid C1+

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby meveric » Mon Aug 31, 2015 8:17 pm

doesn't matter as long as you start it as root (or with sudo)
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7359
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby inf3rno » Mon Feb 15, 2016 10:48 am

I would rather use gparted on my PC with Fedora 23 and a micro SD - USB adapter. Is there anything special in the partition resize process which requires this script?
inf3rno
 
Posts: 36
Joined: Fri Feb 05, 2016 7:17 pm
languages_spoken: english
ODROIDs: Odroid XU4

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby meveric » Mon Feb 15, 2016 2:44 pm

nope.. using gparted works just fine
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 7359
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: ODROID-X2,ODROID-U2,ODROID-U3,ODROID-XU-Lite, ODROID-XU3, ODROID-XU3-Lite, ODROID-C1, ODROID-XU4, ODROID-C2

Re: [HOWTO] Resize Your Linux Partition LIVE

Unread postby Mikitz » Sat Jun 24, 2017 5:37 pm

mdrjr wrote:Ugh. This script is made to be executed on the board with the OS running not on your PC


This is an easy fix. Simply run the following from a terminal.
Code: Select all
wget -O resize.sh https://forum.odroid.com/download/file.php?id=502


Then, all of the commands in the OP will function properly.

Piece of cake, it is :)
Mikitz
 
Posts: 8
Joined: Mon Jul 04, 2016 9:50 pm
languages_spoken: english, 한국어, 中文
ODROIDs: XU4


Return to Ubuntu (All Linux'es)

Who is online

Users browsing this forum: No registered users and 3 guests