[Addon] Expand Partition to Full SD Card

General discussion about RuneAudio. Do not post any support or feature requests here.

[Addon] Expand Partition to Full SD Card

Postby rern » 15 Jun 2017, 11:57

[Tips] Expand Partition to Full SD Card
Tested on RPi3
for RuneAudio 0.3 and 0.4b


    - RuneAudio install to 2GB partition by default.
    - This left the rest of the SD card not available for use.
    - The following script will expand the partiton to full capacity without reboot.

View code - GitHub

Expand
from Addons Menu

Note:
    Basically, it's just a script:
    echo -e 'd\n\nn\n\n\n\n\nw' | fdisk /dev/mmcblk0
    but use it at your own risk.
Last edited by rern on 27 Oct 2017, 02:57, edited 8 times in total.
rAudio @ https://github.com/rern/rAudio-1
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 723
Joined: 14 Jul 2016, 08:15

Re: [Tips] Expand Partition to Full SD Card

Postby zomtec » 17 Jun 2017, 19:41

i get

Code: Select all
[root@runeaudio ~]# wget -qN --show-progress https://github.com/rern/RuneAudio/raw/master/expand_partition/expand.sh; chmod +x expand.sh; ./expand.sh
wget: unrecognized option '--show-progress'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
chmod: cannot access 'expand.sh': No such file or directory
-bash: ./expand.sh: No such file or directory
zomtec
 
Posts: 15
Joined: 17 Jun 2017, 19:39

Re: [Tips] Expand Partition to Full SD Card

Postby rern » 19 Jun 2017, 02:50

1. Find the --show-progress option
Code: Select all
wget --help | grep 'show-progress'

It should show this if the option is there:
Code: Select all
#       --show-progress             display the progress bar in any verbosity mode


2. Try wget without options
Code: Select all
wget https://github.com/rern/RuneAudio/raw/master/expand_partition/expand.sh; chmod +x expand.sh; ./expand.sh
rAudio @ https://github.com/rern/rAudio-1
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 723
Joined: 14 Jul 2016, 08:15

Re: [Tips] Expand Partition to Full SD Card

Postby irishwill2008 » 19 Jun 2017, 08:41

Good post but runeaudio already has a published method: http://www.runeaudio.com/documentation/ ... tition-sd/
irishwill2008
 
Posts: 157
Joined: 26 Jul 2016, 14:49
Location: Ireland

Re: [Tips] Expand Partition to Full SD Card

Postby hondagx35 » 19 Jun 2017, 09:40

Hi rern,

thank you for posting this.
I would like to see this as an option on the settings page.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: [Tips] Expand Partition to Full SD Card

Postby rern » 20 Jun 2017, 13:54

Hi Frank,

I've been thinking it should be done by default at the very first boot.

May be something like:
- a systemd service
- an fdisk script
- remove the service and the script

rern
rAudio @ https://github.com/rern/rAudio-1
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 723
Joined: 14 Jul 2016, 08:15

Re: [Tips] Expand Partition to Full SD Card

Postby rern » 23 Jun 2017, 06:08

Hi Frank,

This systemd run once method was tested successfully:
(Scripts and files in the link were included to the SD card before first boot.)

Code: Select all
# systemd startup service
### script: /etc/systemd/expand.service
ln -s /etc/systemd/expand.service /etc/systemd/system/multi-user.target.wants/expand.service

# fdisk script
### script: /root/expand.sh
chmod +x /root/expand.sh

# 'partprobe' to avoid reboot
### file: /usr/bin/partprobe
chmod +xr /usr/bin/partprobe

### file: /usr/lib/libparted.so.2.0.1
ln -s /usr/lib/libparted.so.2.0.1 /usr/lib/libparted.so.2


rern
rAudio @ https://github.com/rern/rAudio-1
Raspberry Pi 4B
Raspberry Pi 3B > SMSL M8 DAC
Raspberry Pi Zero W
User avatar
rern
 
Posts: 723
Joined: 14 Jul 2016, 08:15

Re: [Tips] Expand Partition to Full SD Card

Postby zomtec » 24 Jun 2017, 19:24

Work it with a Raspberry Zero?

20160618_runeaudio_raspberry1_raspberryZero.img.gz
raspberry-pi-zero-support-in-0-4-t3711-70.html#p20577
zomtec
 
Posts: 15
Joined: 17 Jun 2017, 19:39

Re: [Tips] Expand Partition to Full SD Card

Postby hondagx35 » 24 Jun 2017, 22:05

Hi zomtec,

expanding the sd card works on all devices and you can use both methods
The one posted here or the one explained in the docs.

Frank
User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: [Tips] Expand Partition to Full SD Card

Postby zomtec » 25 Jun 2017, 16:31

I get a error

Code: Select all
[root@runeaudio ~]# wget -qN --show-progress https://github.com/rern/RuneAudio/raw/master/expand_partition/expand.sh; chmod +x expand.sh; ./expand.sh
wget: unrecognized option '--show-progress'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
chmod: cannot access 'expand.sh': No such file or directory
-bash: ./expand.sh: No such file or directory
[root@runeaudio ~]#


Code: Select all
[root@runeaudio ~]# wget -qN https://github.com/rern/RuneAudio/raw/master/expand_partition/expand.sh; chmod +x expand.sh; ./expand.sh
./expand.sh: line 34: python2: command not found
sfdisk: invalid option -- 'F'

Usage:
 sfdisk [options] <device>...

Options:
 -s, --show-size           list size of a partition
 -c, --id                  change or print partition Id
     --change-id           change Id
     --print-id            print Id
 -l, --list                list partitions of each device
 -d, --dump                idem, but in a format suitable for later input
 -i, --increment           number cylinders etc. from 1 instead of from 0
 -u, --unit <letter>       units to be used; <letter> can be one of
                             S (sectors), C (cylinders), B (blocks), or M (MB)
 -1, --one-only            reserved option that does nothing currently
 -T, --list-types          list the known partition types
 -D, --DOS                 for DOS-compatibility: waste a little space
 -E, --DOS-extended        DOS extended partition compatibility
 -R, --re-read             make the kernel reread the partition table
 -N <number>               change only the partition with this <number>
 -n                        do not actually write to disk
 -O <file>                 save the sectors that will be overwritten to <file>
 -I <file>                 restore sectors from <file>
 -V, --verify              check that the listed partitions are reasonable
 -v, --version             display version information and exit
 -h, --help                display this help text and exit

Dangerous options:
 -f, --force               disable all consistency checking
     --no-reread           do not check whether the partition is in use
 -q, --quiet               suppress warning messages
 -L, --Linux               do not complain about things irrelevant for Linux
 -g, --show-geometry       print the kernel's idea of the geometry
 -G, --show-pt-geometry    print geometry guessed from the partition table
 -A, --activate[=<device>] activate the bootable flag
 -U, --unhide[=<device>]   set partition as unhidden
 -x, --show-extended       also list extended partitions in the output,
                             or expect descriptors for them in the input
     --leave-last          do not allocate the last cylinder
     --IBM                 same as --leave-last
     --in-order            partitions are in order
     --not-in-order        partitions are not in order
     --inside-outer        all logicals inside outermost extended
     --not-inside-outer    not all logicals inside outermost extended
     --nested              every partition is disjoint from all others
     --chained             like nested, but extended partitions may lie outside
     --onesector           partitions are mutually disjoint

Override the detected geometry using:
 -C, --cylinders <number>  set the number of cylinders to use
 -H, --heads <number>      set the number of heads to use
 -S, --sectors <number>    set the number of sectors to use

For more details see sfdisk(8).
./expand.sh: line 40: +  : syntax error: operand expected (error token is "+  ")
./expand.sh: line 42: ((: < 10: syntax error: operand expected (error token is "< 10")

=========================================================

    Expand partition

=========================================================

Current partiton: /dev/mmcblk0p5
Available free space  MB
Available unused disk space:  MB

Expand partiton to full unused space:
  0 Cancel
  1 Expand

0 / 1 ?
1
---------------------------------------------------------
Get package file ...
---------------------------------------------------------

wget: unrecognized option '--show-progress'
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
loading packages...
error: 'parted-3.2-5-armv7h.pkg.tar.xz': could not find or read package
rm: cannot remove 'parted-3.2-5-armv7h.pkg.tar.xz': No such file or directory

---------------------------------------------------------
Expand partiton ...
---------------------------------------------------------

./expand.sh: line 80: partprobe: command not found
resize2fs 1.42.12 (29-Aug-2014)
The filesystem is already 434944 (4k) blocks long.  Nothing to do!

./expand.sh: line 88: python2: command not found


 i  Partiton /dev/mmcblk0p5 now has  MB free space.

---------------------------------------------------------

[root@runeaudio ~]#
zomtec
 
Posts: 15
Joined: 17 Jun 2017, 19:39

support RuneAudio Donate with PayPal

Next

Return to General discussion

Who is online

Users browsing this forum: No registered users and 3 guests
cron