[HOWTO] Resize Your Linux Partition LIVE

mdrjr
Site Admin
Posts: 11774
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 33 times
Contact:

[HOWTO] Resize Your Linux Partition LIVE

Post by mdrjr »

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 12444 times
These users thanked the author mdrjr for the post:
aveekbhat (Sun Nov 08, 2020 6:20 pm)

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

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

Post by memeka »

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

mdrjr
Site Admin
Posts: 11774
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 33 times
Contact:

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

Post by mdrjr »

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.

User avatar
memeka
Posts: 4420
Joined: Mon May 20, 2013 10:22 am
languages_spoken: english
ODROIDs: XU rev2 + eMMC + UART
U3 + eMMC + IO Shield + UART
Has thanked: 2 times
Been thanked: 60 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by memeka »

We were talking about it here: http://forum.odroid.com/viewtopic.php?f ... =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 :)

osterluk
Posts: 311
Joined: Sun Feb 24, 2013 2:07 am
languages_spoken: English
ODROIDs: Odroid-U2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by osterluk »

Nice. This will help a lot of people.
Thanks

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

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by wmseward »

Nice simple script. Code review is easy!

Now I want to write a script.

Thanx!

TSC
Posts: 41
Joined: Sat May 11, 2013 9:51 pm
languages_spoken: english, portuguese
ODROIDs: ODROID-X2 / U3
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by TSC »

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.

mdrjr
Site Admin
Posts: 11774
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 33 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by mdrjr »

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

TSC
Posts: 41
Joined: Sat May 11, 2013 9:51 pm
languages_spoken: english, portuguese
ODROIDs: ODROID-X2 / U3
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by TSC »

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.

mdrjr
Site Admin
Posts: 11774
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 33 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by mdrjr »

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

TSC
Posts: 41
Joined: Sat May 11, 2013 9:51 pm
languages_spoken: english, portuguese
ODROIDs: ODROID-X2 / U3
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by TSC »

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

labsin
Posts: 5
Joined: Thu Feb 19, 2015 7:50 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by labsin »

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.

rakekniven
Posts: 3
Joined: Fri Feb 20, 2015 4:49 pm
languages_spoken: english, german
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by rakekniven »

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?

mdrjr
Site Admin
Posts: 11774
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 33 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by mdrjr »

Use ODROID Utility to do that.

rakekniven
Posts: 3
Joined: Fri Feb 20, 2015 4:49 pm
languages_spoken: english, german
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by rakekniven »

Done that in the meantime. Works pretty well.
Thx.

labsin
Posts: 5
Joined: Thu Feb 19, 2015 7:50 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by labsin »

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 797 times

weyb
Posts: 30
Joined: Fri Mar 20, 2015 9:28 pm
languages_spoken: english
ODROIDs: C1
Location: Grasse (06 France)
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by weyb »

mdrjr wrote:Use ODROID Utility to do that.
for the newbies like me : it's on the Ubuntu desktop !

atodea
Posts: 3
Joined: Sat Mar 08, 2014 6:30 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by atodea »

Thank you.
It works like a charm!

Cerin
Posts: 2
Joined: Mon Jun 01, 2015 10:32 am
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by Cerin »

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?

mdrjr
Site Admin
Posts: 11774
Joined: Fri Feb 22, 2013 11:34 pm
languages_spoken: english, portuguese
ODROIDs: -
Location: Brazil
Has thanked: 1 time
Been thanked: 33 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by mdrjr »

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?

ceVoIX
Posts: 7
Joined: Tue Aug 25, 2015 10:23 pm
languages_spoken: german, english
ODROIDs: Odroid C1+
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by ceVoIX »

Hi,
I am a linux beginner, in which folder i have to grab the resize.sh file?

User avatar
meveric
Posts: 11250
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by meveric »

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.

inf3rno
Posts: 37
Joined: Fri Feb 05, 2016 7:17 pm
languages_spoken: english
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by inf3rno »

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?

User avatar
meveric
Posts: 11250
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, HC4
Has thanked: 52 times
Been thanked: 423 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by meveric »

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.

Mikitz
Posts: 13
Joined: Mon Jul 04, 2016 9:50 pm
languages_spoken: english, 한국어, 中文
ODROIDs: XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by Mikitz »

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

Max Headroom
Posts: 14
Joined: Thu Sep 14, 2017 8:33 am
languages_spoken: english
ODROIDs: XU-4
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by Max Headroom »

Hello, this is what I have done and these are the result. It ain't working! Also, for those claiming that resize is on the desktop, please be more specific. Where? Thanks in advance.
odroid@odroid:~$ wget -o resize.sh download/file.php?id=502
odroid@odroid:~$ chmod +x resize.sh
odroid@odroid:~$ sudo ./resize.sh
[sudo] password for odroid:
./resize.sh: 1: ./resize.sh: --2017-09-19: not found
./resize.sh: 2: ./resize.sh: Syntax error: "(" unexpected
odroid@odroid:~$ wget -o resize.sh download/file.php?id=502
odroid@odroid:~$ chmod +x resize.sh
odroid@odroid:~$ sudo ./resize.sh
[sudo] password for odroid:
./resize.sh: 1: ./resize.sh: --2017-09-19: not found
./resize.sh: 2: ./resize.sh: Syntax error: "(" unexpected

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

Can you check the downloaded file contents? I think you should use "-O" instead of "-o".

Code: Select all

#!/bin/bash

fdisk_first() {
		p2_start=`fdisk -l /dev/mmcblk0 | grep mmcblk0p2 | awk '{print $2}'`
		echo "Found the start point of mmcblk0p2: $p2_start"
		fdisk /dev/mmcblk0 << __EOF__ >> /dev/null
d
2
n
p
2
$p2_start

p
w
__EOF__

		sync
		touch /root/.resize
		echo "Ok, Partition resized, please reboot now"
		echo "Once the reboot is completed please run this script again"
}

resize_fs() {
	echo "Activating the new size"
	resize2fs /dev/mmcblk0p2 >> /dev/null
	echo "Done!"
	echo "Enjoy your new space!"
	rm -rf /root/.resize
}


if [ -f /root/.resize ]; then
	resize_fs
else
	fdisk_first
fi
BTW, our latest Ubuntu images are resizing the rootfs automatically in the first boot process.

Max Headroom
Posts: 14
Joined: Thu Sep 14, 2017 8:33 am
languages_spoken: english
ODROIDs: XU-4
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by Max Headroom »

Hello,
First, Thanks for sending a copy of the script with your message. Next, I am using a 32GB micro sd card. When I look under System and 'Display disks' the first disk is labeled mmcblk1p1 is 134MB total and 119MB free. The Second is: mmcblk1p2 and 32GB 26GB free. Should I replace the mmcblk0 in the script with mmcblk1p1 in order to get the script to work?
How should I run this? double click and 'run in terminal', RUN, or? Finally I wondered if that character was zero, small letter o or capital O I found it difficult to determine which.
P.S. I managed to get a download of the script. Every way I try to run it I receive the same message as listed in my previous query. I obtained the image two days ago from U.S. East website. I tried U.S. West using a 32 bit Win 7 system. What I got was a looooong page full of ASCII characters that froze until 1.3 GB download was done. I did not get a 'file'. Thanks again!

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

Try "cat resize.sh" to check the script.
And run it with "sudo ./resize.sh".

BTW, which OS image did you flash to your 32GB sd card?

Max Headroom
Posts: 14
Joined: Thu Sep 14, 2017 8:33 am
languages_spoken: english
ODROIDs: XU-4
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by Max Headroom »

Hello,
I flashed: ubuntu-16.04.3-4.9-mate-odroid-xu4-20170824.img.xz 2017-08-25 12:35 1.2G off the mirror site. Again, due to the anomalous download from the main site. I am using Windows 7 32 bit on a Dell machine. Also, because it took days to troubleshoot and determine the main site yielded anomalus downloads. I ordered the 16GB pre-flashed-SD from Odroid. I received it yesterday. It has two partitions on it, a 134MB and a 16GB. It is just like the 32GB SD I flashed except its capacity is smaller. In each one the 'reported name of each partition is: mmcblk1p1 and mmcblk1p2 respectively.

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

Those new images has a feature of autoresizing in the first booting process.
Check "df -H" output on the command line.

Max Headroom
Posts: 14
Joined: Thu Sep 14, 2017 8:33 am
languages_spoken: english
ODROIDs: XU-4
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by Max Headroom »

Hello Odroid,
Either these features exist on the SD Drive from the store as well as the 32GB SD card I flashed or they do not. I believe that I have Adequately explained that Linux is reporting that I have two partitions and that they are designated /dev/mmcblk1p1 and /dev/mmcblk1p2. I would point out that since this is what Linux-mate is reporting and all indications are that this is true, then I have two partitions. IF these freatures you are alluding to exist... they are failing or non-existant. So, I am telling you I have two partitions if I am supposed to have a solitary partition, something is failing. I guess I will go to the web, maybe someone else has written a script to repartition an existing SD card while preserving the data. Thanks for your attention.

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

Our Ubuntu image has two partitions. Boot(VFAT) and rootfs(EXT4) partitions.
https://wiki.odroid.com/odroid-xu4/soft ... tion_table

dirtyrobinson
Posts: 36
Joined: Sun Jan 19, 2014 8:49 am
languages_spoken: english
ODROIDs: Odroid U3 & C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by dirtyrobinson »

I ran this script to resize my 16gb SD card but now it won't boot nor is it recognized by any of my other boards. Windows shows that the partition was expanded at least but I can't access the linux partition to recover data. I think it screwed up the boot.ini getting the following errors on boot:

mmcblk0: r/w command failed, status = 0x80000b00
end_request: I/O error, dev mmcblk0, sector 31225848
Buffer I/O error on device mmcblk0, logical block 3903231
mmc_blk_reset 938 error md->reset_done:1 and type:1

emmc: mmc_rescan_try_freq: trying to init card at 300000 Hz

update: I am able to access the partition using Ext2Explore to recover data and/or edit files, I still wanna repair this so any help is appreciated!

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

Our official images automatically resize the rootfs in the first boot process.
Which OS image did you use?

dirtyrobinson
Posts: 36
Joined: Sun Jan 19, 2014 8:49 am
languages_spoken: english
ODROIDs: Odroid U3 & C1
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by dirtyrobinson »

I don't remember which image exactly, I don't think it was an official image. My image is just named as C2-Debian. This specific board has been set up for over a year now so I would have to dig through some notes to see if I made a note of which image it was.

I just realized today that I'm only using half the storage so thought why not resize it quick... fail

alexharnozd
Posts: 24
Joined: Wed Sep 26, 2018 11:05 pm
languages_spoken: english
ODROIDs: HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by alexharnozd »

Hi @odroid ,

So what does the last "how to" partition LIVE that we can use nowadays ?

I am using/flash with OMV 4.XX image for odroid Xu4 , i m suing HC2 by the way ,
I m using 32 G , but result of df -H is only 7.9G .

/dev/mmcblk1p2 7.9G 1.9G 5.4G 27% /

Thank you for advise .

Alex :geek:

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

@alexharnozd,
When you run the OMV 4.x first time, wait 5~10 minutes.
It will resize the root file system automatically.

alexharnozd
Posts: 24
Joined: Wed Sep 26, 2018 11:05 pm
languages_spoken: english
ODROIDs: HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by alexharnozd »

odroid wrote:
Mon Mar 11, 2019 6:28 pm
@alexharnozd,
When you run the OMV 4.x first time, wait 5~10 minutes.
It will resize the root file system automatically.
Hi Odroid ,

I m sorry , this omv 4.x has been run for few months . :)

and , this mmcblk1p2 does not changed or repartitioned it self at all .

any tutorial on how to do it ? @odroid ?

User avatar
odroid
Site Admin
Posts: 35869
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1316 times
Been thanked: 908 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by odroid »

I think you might interrupt the first self-resizing process.
Connect your SD card to a Linux PC and use "gparted" to resize the rootfs.

alexharnozd
Posts: 24
Joined: Wed Sep 26, 2018 11:05 pm
languages_spoken: english
ODROIDs: HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by alexharnozd »

odroid wrote:
Mon Mar 11, 2019 6:31 pm
I think you might interrupt the first self-resizing process.
Connect your SD card to a Linux PC and use "gparted" to resize the rootfs.
any easier way ?
Currently i m using debian stretch running on it (HC2), can i use LIVE method , as i dont have any other linux computer , basically , i m very new in linux and all the flavor .

can we use gparted on this HC2 itself - live from HC2 such as

$sudo wget "something something"
$sudo run "something something"

User avatar
tobetter
Posts: 6617
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 328 times
Been thanked: 921 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by tobetter »

alexharnozd wrote:
Mon Mar 11, 2019 6:35 pm
odroid wrote:
Mon Mar 11, 2019 6:31 pm
I think you might interrupt the first self-resizing process.
Connect your SD card to a Linux PC and use "gparted" to resize the rootfs.
any easier way ?
Currently i m using debian stretch running on it (HC2), can i use LIVE method , as i dont have any other linux computer , basically , i m very new in linux and all the flavor .

can we use gparted on this HC2 itself - live from HC2 such as

$sudo wget "something something"
$sudo run "something something"
It would be a bit risky, you could lose your data. What if you install another Linux to HC2 and connect the current SD card with USB card reader? Your SD card would be resized by new Linux. :)

alexharnozd
Posts: 24
Joined: Wed Sep 26, 2018 11:05 pm
languages_spoken: english
ODROIDs: HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by alexharnozd »

tobetter wrote:
Mon Mar 11, 2019 7:03 pm
alexharnozd wrote:
Mon Mar 11, 2019 6:35 pm
odroid wrote:
Mon Mar 11, 2019 6:31 pm
I think you might interrupt the first self-resizing process.
Connect your SD card to a Linux PC and use "gparted" to resize the rootfs.
any easier way ?
Currently i m using debian stretch running on it (HC2), can i use LIVE method , as i dont have any other linux computer , basically , i m very new in linux and all the flavor .

can we use gparted on this HC2 itself - live from HC2 such as

$sudo wget "something something"
$sudo run "something something"
It would be a bit risky, you could lose your data. What if you install another Linux to HC2 and connect the current SD card with USB card reader? Your SD card would be resized by new Linux. :)
Ohh naww, i managed to get this all done for a timed.
And used it for my daily backup server.
Hahahahaha
I cant risk thing like lose all of my data.
Btw. Im a risk taker guys.
Any tuts on how to do?
Or show me safer way.

Haha

Thank you

Alex

alexharnozd
Posts: 24
Joined: Wed Sep 26, 2018 11:05 pm
languages_spoken: english
ODROIDs: HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by alexharnozd »

Does it mean.

1. Download official linux image from odroid
2. Install and run new linux image on hc2
3. Usb in with reader for old sd card
And run partition from there? Via... Linux command

alexharnozd
Posts: 24
Joined: Wed Sep 26, 2018 11:05 pm
languages_spoken: english
ODROIDs: HC2
Has thanked: 0
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by alexharnozd »

Will it screwed up/mixed up with the data i have from my old sd card 32g? After i do this all?

dstair
Posts: 44
Joined: Sun Oct 22, 2017 1:21 am
languages_spoken: english
ODROIDs: XU4, HC1, HC2, MC1
Location: United States, Indiana
Has thanked: 2 times
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by dstair »

When I originally installed OMV I only had available a 64 GB sd card. Now I want to back it up and only have a 16 GB card. Is there a way to resize the 3rd partition using Gparted or something of that nature, small enough that I can then use dd to copy?

mad_ady
Posts: 8817
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 586 times
Been thanked: 528 times
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by mad_ady »

Not sure what filesystems omv uses, but you can try odroid-backup. It will resize the last partition to fill the available space when restoring.

dstair
Posts: 44
Joined: Sun Oct 22, 2017 1:21 am
languages_spoken: english
ODROIDs: XU4, HC1, HC2, MC1
Location: United States, Indiana
Has thanked: 2 times
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by dstair »

I believe it is on a lite version of stretch

dstair
Posts: 44
Joined: Sun Oct 22, 2017 1:21 am
languages_spoken: english
ODROIDs: XU4, HC1, HC2, MC1
Location: United States, Indiana
Has thanked: 2 times
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE (ended up just copying the 2 partitions as is from 64 GB card to a 16 GB ca

Post by dstair »

I used the following link as the resource to aid me in cloning OMV from a 64 GB card to a 16 GB card
https://www.howtoforge.com/tutorial/lin ... l-example/

You may need to install pv

Code: Select all

sudo apt install pv
To copy individual partitions or copy from say a 64 GB card to a 16 GB card

In command prompt enter

Code: Select all

$ sudo lsblk
Find the drive you want to backup (this example will use sdx --> sdb)
sdb1
sdb2
Insert the next drive
In command prompt enter

Code: Select all

$ sudo lsblk
find the drive letter to backu up to (this example will use sdx --> sdc)
sdc1
Now we must unmount the partitions, not the drives, to copy or clone

Code: Select all

$ sudo umount /dev/sdb1

Code: Select all

$ sudo umount /dev/sdb2

Code: Select all

$ sudo umount /dev/sdc1
Now the backup command to clone from sdb to sdc

Code: Select all

$ sudo fdisk -l /dev/sdb
I believe my math is correct for the next section (it worked perfectly)

First, find the end of the last partition you wish to copy.
This example the end of partition 2 is 14900000. The block size is 512. I will use 4096, which is 514*4
This example we will have to specify the size of the memory to copy, the end of the second partition. Since the end is 14900000 and we used 4096 BS,
then 14900000/4 = 3725000 will be the new block SIZE

Code: Select all

$ sudo dd if=/dev/sdb bs=4096 count=3725000 conv=sync,noerror status=proggess | pv -s 8G |sudo dd of=/dev/sdc

User avatar
MysteryScience
Posts: 32
Joined: Sun Dec 23, 2018 9:09 pm
languages_spoken: english, spanish
ODROIDs: XU4Q, XU4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: [HOWTO] Resize Your Linux Partition LIVE

Post by MysteryScience »

Hi guys,

Maybe this is strange but there is a way to NOT resize the Linux partition automatically? when you use the official Odroids Ubuntu images.

I mean, the opposite I don't want to use all the space in the sd card because I'm looking to create a new partition but it's impossible due root filesystem it's taking all the space

Thanks and kind regards.

Post Reply

Return to “Ubuntu (All Linux'es)”

Who is online

Users browsing this forum: No registered users and 3 guests