SqueezePlay OS Recipes

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
guidows
Posts: 52
Joined: Sat Jun 18, 2011 7:07 am

Re: SqueezePlay OS Recipes

Post by guidows »

how to resize (extend) a partition in a usb disk

DO NOT USE IN A LIVE SYSTEM. Do it from other pc, live cd, internal joggler partition, etc.

(as root user)

the example is about resizing the second partition (sda2) of the disk sda. By example, when you have a 4g image transferred to a 8 or more capacity pendrive.


___
umount /dev/sda1
umount /dev/sda2

fdisk /dev/sda
root@openframe:~# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 8086 MB, 8086618112 bytes
4 heads, 32 sectors/track, 123392 cylinders, total 15794176 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
Disk identifier: 0x000b6ddf

Device Boot Start End Blocks Id System
/dev/sda1 * 1 62500 31250 e W95 FAT16 (LBA)
/dev/sda2 63488 1951743 944128 83 Linux

Command (m for help): d
Partition number (1-4): 2

Command (m for help): n
Partition type:
p primary (1 primary, 0 extended, 3 free)
e extended
Select (default p): p
Partition number (1-4, default 2): 2
First sector (62501-15794175, default 62501): 63488
Last sector, +sectors or +size{K,M,G} (63488-15794175, default 15794175): PRESS ENTER

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
then:


root@openframe:~# resize2fs /dev/sda2
Resizing the filesystem on /dev/sda2 to 1966336 (4k) blocks.

and finally a fsck -y /dev/sda2
done :-)
Last edited by guidows on Thu Aug 07, 2014 5:17 am, edited 5 times in total.
User avatar
roobarb!
Posts: 1769
Joined: Sat Mar 05, 2011 1:30 pm
Location: Salford, UK
Contact:

Re: SqueezePlay OS Recipes

Post by roobarb! »

That's a very handy one to have - save messing with GPartEd! :)
BirdsLikeWires - Get fresh builds of Debian Bullseye, Bookworm, and Trixie for OpenFrame with the latest 5.10, 6.1, and 6.12 kernels! 8-)
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

This may be very timely! getting a no disk space error when updating LMS.

So, before I mess up everything (!):

I'm running SpqOS on a 4 GB stick - with LMS on same stick.

Can I use the above commands without modification?
User avatar
pete
Posts: 2961
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: SqueezePlay OS Recipes

Post by pete »

Yes as long as its not mounted.
root@openframe:~# umount /media/usb1
root@openframe:~# resize2fs /dev/sda2

and finally a fsck -y /dev/sdb2
I have flip flopped mostly using GParted on another machine and just plugging in the USB stick to said machine.

Recently I did extend the root partition of a 16Gb SSD to an 8 Gb SSD cuz I ran out of space. This gets a bit more involved but did allow for some 24Gb base OS stuff on the OS mounted on the SSD drives. (all internal). I am now seeing 32Gb tiny SSD ZIF drives which would fit inside of the Joggler such that you could do a 32GB USB SSD plus a 32Gb ZIF SSD to give you some 64Gb of internal play space.
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

I followed the code. Then did:

root@openframe:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 908M 743M 119M 87% /
udev 246M 4.0K 246M 1% /dev
none 192M 20K 192M 1% /tmp
tmpfs 100M 340K 99M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
none 256M 0 256M 0% /var/cache/apt
none 256M 0 256M 0% /var/lib/apt/lists
none 16M 408K 16M 3% /var/log
/dev/sda1 31M 10M 21M 33% /boot
/dev/sda2 908M 743M 119M 87% /media/usb0
/dev/sda1 31M 10M 21M 33% /media/usb1
root@openframe:~#

Doesn't look as if it's using the 4gb
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

In fact, looks as if it's screwed.

This what I get now:

login as: root
root@192.168.1.20's password:
root@openframe:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda2 908M 743M 119M 87% /
udev 246M 4.0K 246M 1% /dev
none 192M 20K 192M 1% /tmp
tmpfs 100M 340K 99M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 248M 0 248M 0% /run/shm
none 256M 0 256M 0% /var/cache/apt
none 256M 0 256M 0% /var/lib/apt/lists
none 16M 400K 16M 3% /var/log
/dev/sda1 31M 10M 21M 33% /boot
/dev/sda2 908M 743M 119M 87% /media/usb0
/dev/sda1 31M 10M 21M 33% /media/usb1
root@openframe:~# umount /media/usb1
root@openframe:~# resize2fs /dev/sda2
resize2fs 1.42 (29-Nov-2011)
Filesystem at /dev/sda2 is mounted on /; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
resize2fs: Kernel does not support online resizing
root@openframe:~#
ilovemyjoggler
Posts: 711
Joined: Sun May 13, 2012 4:42 pm

Re: SqueezePlay OS Recipes

Post by ilovemyjoggler »

Castalla, my set up is same ss yours. I've often thought i should do something about partitions but it makes me nervous. If you get this to work can you please post your 'how to'??? It would be much appreciated.
User avatar
pete
Posts: 2961
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: SqueezePlay OS Recipes

Post by pete »

Apologies for the tangent from the OP a bit here; just stuff relating to how much HD space you can put inside of your Joggler.

Here is a quickie speed and size comparison between the MMC, SSD USB and SSD PATA drives all inside of the Joggler.
root@ICS-JogXUbuntu2:~# df -l
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 15451280 5504248 9947032 36% /
udev 247128 8 247120 1% /dev
tmpfs 252048 16 252032 1% /tmp
tmpfs 100820 796 100024 1% /run
none 5120 0 5120 0% /run/lock
none 252048 96 251952 1% /run/shm
none 102400 12 102388 1% /run/user
/dev/sda1 62322 17758 44564 29% /boot
/dev/uba3 7377984 2352912 4650288 34% /media/data
root@ICS-JogXUbuntu2:~# fdisk -l

Disk /dev/sda: 16.4 GB, 16391208960 bytes NOTE: This is the 16Gb SSD PATA drive
255 heads, 63 sectors/track, 1992 cylinders, total 32014080 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
Disk identifier: 0x0006fc82

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 126975 62464 ef EFI (FAT-12/16/32)
/dev/sda2 126976 626687 249856 82 Linux swap / Solaris
/dev/sda3 626688 32012287 15692800 83 Linux

Disk /dev/mmcblk0: 1028 MB, 1028128768 bytes
4 heads, 16 sectors/track, 31376 cylinders, total 2008064 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
Disk identifier: 0x00065065

Device Boot Start End Blocks Id System
/dev/mmcblk0p1 * 16 125055 62520 ef EFI (FAT-12/16/32)
/dev/mmcblk0p2 125056 625151 250048 83 Linux
/dev/mmcblk0p4 626688 2007039 690176 83 Linux

Disk /dev/uba: 7996 MB, 7996538880 bytes NOTE: This is the 8Gb SSD USB drive
255 heads, 63 sectors/track, 972 cylinders, total 15618240 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
Disk identifier: 0x000e8631

Device Boot Start End Blocks Id System
/dev/uba1 * 2048 126975 62464 ef EFI (FAT-12/16/32)
/dev/uba2 126976 626687 249856 82 Linux swap / Solaris
/dev/uba3 626688 15618047 7495680 83 Linux
root@ICS-JogXUbuntu2:~#

root@ICS-JogXUbuntu2:~# hdparm -tT /dev/sda
/dev/sda:
Timing cached reads: 976 MB in 2.00 seconds = 487.48 MB/sec
Timing buffered disk reads: 84 MB in 3.05 seconds = 27.51 MB/sec

root@ICS-JogXUbuntu2:~# hdparm -tT /dev/uba
/dev/uba:
Timing cached reads: 934 MB in 2.00 seconds = 466.44 MB/sec
Timing buffered disk reads: 72 MB in 3.03 seconds = 23.77 MB/sec

root@ICS-JogXUbuntu2:~# hdparm -tT /dev/mmcblk0
/dev/mmcblk0:
Timing cached reads: 890 MB in 2.00 seconds = 445.04 MB/sec
Timing buffered disk reads: 48 MB in 3.03 seconds = 15.86 MB/sec
root@ICS-JogXUbuntu2:~#
For kicks a regular USB stick plugged into a hub plugged into the Joggler.
/dev/ubb1 7799912 4512 7795400 1% /media/joggler/F9A7-D9CF

root@ICS-JogXUbuntu2:~# hdparm -tT /dev/ubb
/dev/ubb:
Timing cached reads: 906 MB in 2.00 seconds = 452.97 MB/sec
Timing buffered disk reads: 52 MB in 3.07 seconds = 16.93 MB/sec
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
User avatar
JimbobVFR400
Posts: 264
Joined: Fri Jul 20, 2012 8:39 pm

Re: SqueezePlay OS Recipes

Post by JimbobVFR400 »

Could you try running the bootable USB or CD version of GParted at all. Its the method I use, I must admit I'd be nervous of resizing a partition in the OS that booted from it if I'm honest.
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

Well, I just can't get this to work with SpqOS 2.

Gone from a working system to a complete mess!

Avoid until somebody else can confirm it works.

Don't have gparted - that's why I tried this method. Blast!
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

I've reverted to version 1.09.

The first thing I notice is that the whole 8gb is already in place. That's without any partition fiddling.

Does this mean that resize is not implemented in version 2.06?

Whatever .. until this is sorted out then my cautionary advice still stands!
User avatar
pete
Posts: 2961
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: SqueezePlay OS Recipes

Post by pete »

Don't get frustrated; it really is simple to resize a build on a USB stick. I have done that a lot with the Joggler stuff.

Which OS do you typically utilize?

Windows ? Mac ?

Can you boot from a USB stick on said above computer / OS? or can you create a boot CDRom/DVDRom from an ISO?

Another way (doing everything you need just with a Joggler) is to make up an Ubuntu boot stick from one of Buzz's builds booting it via a USB hub with a keyboard and mouse.

I keep one handy next to my playing around Joggler.
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

I know how to use a gparted iso.

I'm just pointing out that the 'Recipe' above doesn't seem to work on SpqOS 2.06.
User avatar
pete
Posts: 2961
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: SqueezePlay OS Recipes

Post by pete »

Yup; personally here never really play with partition data en vivo. That said; and this is me; I wouldn't recommend it.

I have though used command line stuff as above for an unmounted partition and its worked fine; flip flopping between that and Gparted.

Found this and quoted it:
It really depends on the filesystem you are using but in most cases the answer is to use a livecd (Since it comes with gparted) but it is highly NOT recommended to resize a mounted, usable partition.

It is filesystem and partition dependant, different flesystems and partitions will use different methods. AFAIK it's usually used on lvm partitions. If you are using Gparted, the safe thing to do is to umount it first.

Usually you use lvextend and resizefs in lvm partitions. You can find more info on their man pages. Again it's not a good idea to do with "normal" partitions.

First you have to expand the underlying block device. If you are using a conventional partition on a single hard disk, this is not possible. LVM and mdadm can expand the block device, then you can run resize2fs to expand the fs ( assuming it is ext[234] ).
http://askubuntu.com/questions/23067/ho ... -partition
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

So, my note of caution still stands?
User avatar
pete
Posts: 2961
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: SqueezePlay OS Recipes

Post by pete »

yes
Well, I just can't get this to work with SpqOS 2.
Gone from a working system to a complete mess!
Avoid until somebody else can confirm it works.
Don't have gparted - that's why I tried this method. Blast!
Personally and related to Linux; used to command line and still getting used to GUI (after many many years).

That said I do not like using VI anymore and prefer anything else today.
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
User avatar
roobarb!
Posts: 1769
Joined: Sat Mar 05, 2011 1:30 pm
Location: Salford, UK
Contact:

Re: SqueezePlay OS Recipes

Post by roobarb! »

castalla wrote:I know how to use a gparted iso.

I'm just pointing out that the 'Recipe' above doesn't seem to work on SpqOS 2.06.
You're right - tested tonight and no dice. Procedure is sound, but I'll have to go away and look at the kernel and ext2 resizing. It works pretty well for the Pi people, after all.
castalla wrote:The first thing I notice is that the whole 8gb is already in place. That's without any partition fiddling.
I'm guessing you're just seeing the total size of the stick here - none of the versions of SQPOS will automatically resize; they start off as 1GB unless you play about with GPartEd.
BirdsLikeWires - Get fresh builds of Debian Bullseye, Bookworm, and Trixie for OpenFrame with the latest 5.10, 6.1, and 6.12 kernels! 8-)
castalla
Posts: 860
Joined: Wed May 29, 2013 10:33 am

Re: SqueezePlay OS Recipes

Post by castalla »

I guess I must have used gparted at some point, then!
User avatar
pete
Posts: 2961
Joined: Mon Aug 01, 2011 6:33 am
Location: Time Traveler

Re: SqueezePlay OS Recipes

Post by pete »

Yup; don't recall anymore what I used but did fit the original XBMC on to the Openframe 7 MMC (2Gb) a while back. Worked fine until I filled up the DB.
- Pete
O2 Jogglers running EFI Ubuntu / Squeezeplayer
OpenPeak Voip Telephony / Zigbee tabletops hardware modded with Seabios / RTC / Ethernet ROM edits / SSD drives running XPe for automation screens

Auto mater
guidows
Posts: 52
Joined: Sat Jun 18, 2011 7:07 am

Re: SqueezePlay OS Recipes

Post by guidows »

Well... I checked the recipe. I made ​​the mistake of not explaining clearly that it has to be made from another linux box (I do from sqp OS installed on the internal joggler disk) and, just in case, it is necessary unmount the drive partitions first (in case that you have an automagic mount daemon).

I added the necessary commands and at least for me it worked in SqueezePlay OS 2.06 without any problem in a recent install.
Post Reply