Page 1 of 2
USB Partition
Posted: Fri Mar 04, 2011 11:22 am
by michaelm
Hey guys
I am using a 16GB USB Flash drive on the btrfs (comp) image through a USB extension cable to hide some of the cable clutter.
It all seems to work well for now.
The image install obviously only took 4 GB of space on the stick which means I have 12GB left. Is there anyway I can partition this stick without having to re-install Jolicloud and make the 12GB available to me for photos etc?
I have a full version of Jolicloud running on another PC and I can use the gparted there to re-partition but as a newbie I have no idea what file format to choose etc.
Finally do you think NOT using the USB extension cable will give me any speed benefits?
Thanks in advance
Michael
Re: USB Partition
Posted: Fri Mar 04, 2011 12:00 pm
by dwl99
You can create a new partition using the unallocated space. The format doesn't matter much, ext2 and FAT32 can be read by Ubuntu/Jolicloud. Windows PC's will not be able to see the extra partition even if you choose FAT32 as I think only the first partition is visible. I don't think a cable will be slowing things down.
Re: USB Partition
Posted: Fri Mar 04, 2011 12:23 pm
by michaelm
Thanks will get that sorted just now and report back - cheers
Michael
P.S. Pleased to see another joggler in Glasgow
Re: USB Partition
Posted: Fri Mar 04, 2011 4:18 pm
by BuZz
Another option would be to "grow" the btrfs partition. This can be done on another machine with an modern linux install (ubuntu maverick for example)
for example
put the usb stick in another linux machine and do (replacing /dev/USBDEVICE with /dev/sdb or whatever the device is - be careful to get this right!)
Code: Select all
sudo -s (or switch to root)
OFFSET=`sudo parted -m /dev/USBDEVICE unit s print | grep ^3 | cut -d: -f 2`
sudo parted /dev/USBDEVICE -- unit s rm 3 mkpart primary btrfs $OFFSET -1s
sudo mount /dev/USBDEVICE3 /mnt
sudo btrfsctl -r max /mnt
sudo umount /mnt
you can also try a premade script
http://joggler.exotica.org.uk/source/sc ... zebtrfs.sh
Re: USB Partition
Posted: Fri Mar 04, 2011 4:37 pm
by michaelm
Thanks guys
In the end I used Gparted on my other Jolicloud Machine and created a new partition of the empty space in FAT32 to allow me to use on my Mac for photos etc.
All worked a treat.
Thanks for the advice.
Michael
Re: USB Partition
Posted: Thu Mar 10, 2011 10:10 am
by dwl99
BuZz wrote:Another option would be to "grow" the btrfs partition.
from the joggler open up a terminal and do
Code: Select all
sudo bash -c "OFFSET=`parted -m /dev/sda unit s print | grep ^3 | cut -d: -f 2`; parted /dev/sda -- unit s rm 3 mkpart primary btrfs $OFFSET -1s"
then reboot and open up a terminal again and do
http://joggler.exotica.org.uk/source/sc ... zebtrfs.sh
How long should the sudo bash -c "OFFSET=`parted -m /dev/sda unit s print | grep ^3 | cut -d: -f 2`; parted /dev/sda -- unit s rm 3 mkpart primary btrfs $OFFSET -1s" bit take? It's been running for 2 hours now & the Terminal cursor is still blinking away. I'm trying to grow the partition to 8GB from a compressed btrfs.
Ta
Re: USB Partition
Posted: Thu Mar 10, 2011 7:44 pm
by BuZz
should be instant. if its not doing anything ctrl+c it. and do "parted /dev/sda print" and make sure you have a partition 3 before rebooting. I will double check the commandline now.
[edit]
try doing it like
Code: Select all
OFFSET=`sudo parted -m /dev/USBDEVICE unit s print | grep ^3 | cut -d: -f 2`
sudo parted /dev/USBDEVICE -- unit s rm 3 mkpart primary btrfs $OFFSET -1s
on the joggler USBDEVICE would be sda
I have fixed up the code in the previous posts. It wasnt quite correct sorry.
Re: USB Partition
Posted: Thu Mar 10, 2011 10:02 pm
by dwl99
Thanks, all working now.
EDIT - when I rebooted & entered "sudo btrfsctl -r max /" I got an error message "ioctl:: Invalid argument"
Re: USB Partition
Posted: Wed Mar 16, 2011 7:14 pm
by BuZz
dwl99 wrote:Thanks, all working now.
EDIT - when I rebooted & entered "sudo btrfsctl -r max /" I got an error message "ioctl:: Invalid argument"
yeh sorry, actually parted doesn't let us delete and recreate the partition now (something must have changed to add this "protection") so we have no choice but to try it on another machine.
Re: USB Partition
Posted: Wed Mar 16, 2011 10:48 pm
by silentchill07
What do you mean by try it on another machine ?
Re: USB Partition
Posted: Wed Mar 16, 2011 11:25 pm
by dwl99
Boot your PC into Ubuntu & plug in the Joggler USB stick & it will mount it. Or create a second USB stick & boot the Joggler from that then insert the one you want to resize into the Joggler via a USB hub.
Re: USB Partition
Posted: Thu Mar 17, 2011 6:33 pm
by silentchill07
I tried that booted into ubuntu via live on pc, inserted joggler pendrive, loaded up the partition program, clicked on resize but the sizes that are already set are stated as the maximum.
Re: USB Partition
Posted: Thu Mar 17, 2011 6:38 pm
by BuZz
you cant resize it from gparted. you can try my little shell script though listed earlier. you should also go for the latest image you can get - maybe something like ubuntu natty just for the newer btrfstool and kernel
Re: USB Partition
Posted: Thu Mar 17, 2011 8:14 pm
by silentchill07
Ok here is me doing your instructions and the errors as they appear back: sdi was the pendrive on the ubuntu install for the joggler pendrive.
ubuntu@ubuntu:~$ sudo -s
root@ubuntu:~# sudo bash -c "OFFSET=`parted -m /dev/sdi unit s print | grep ^3 | cut -d: -f 2`; parted /dev/sdi -- unit s rm 3 mkpart primary btrfs $OFFSET -1s"
End? y
Error: Invalid number.
Information: You may need to update /etc/fstab.
root@ubuntu:~# sudo btrfsctl -r max /
ioctl:: Inappropriate ioctl for device
Re: USB Partition
Posted: Thu Mar 17, 2011 8:24 pm
by BuZz
Please try
http://joggler.exotica.org.uk/source/sc ... zebtrfs.sh
as it provides a more automated resize.
I need to test resizing on my system. as I use bleeding edge btrfs on joggler, it is possible that btrfs cant resize for some reason. you can only resize a mounted filesystem bts, which was one step you missed out on.
Re: USB Partition
Posted: Thu Mar 17, 2011 8:35 pm
by silentchill07
I may sound dumb, but i am very new to all this, how do i run that script, i copied it and pasted it into terminal but terminal just closes ?
Re: USB Partition
Posted: Thu Mar 17, 2011 8:48 pm
by roobarb!
silentchill07 wrote:I may sound dumb, but i am very new to all this, how do i run that script, i copied it and pasted it into terminal but terminal just closes ?
You need to download the script and save it as a file, then give it permissions that say it can run. One way to do it is like this, on the command line, one line at a time:
Code: Select all
wget http://joggler.exotica.org.uk/source/scripts/resizebtrfs.sh
Downloads the file with an application called
wget and saves it in whichever directory you happen to be in at the time.
Gives it e
xecute permissions.
Runs it.
In fact, you'll probably need to do this as a superuser, as you're messing with partitions:
Literally,
superuser
do <whatever>.
Re: USB Partition
Posted: Thu Mar 17, 2011 8:57 pm
by BuZz
Thanks roobarb

Re: USB Partition
Posted: Thu Mar 17, 2011 9:37 pm
by silentchill07
Thank You that worked a treat, like being back with Dos 6.2 when i was at school !!!
The very last line needed changing a little to:
sudo ./resizebtrfs.sh /dev/sdb
but i managed to work that out all by myself.

Re: USB Partition
Posted: Fri Mar 18, 2011 1:08 am
by roobarb!
silentchill07 wrote:The very last line needed changing a little to:
sudo ./resizebtrfs.sh /dev/sdb
but i managed to work that out all by myself.

Awesome.
Not used the script myself (yet!), but I guess it makes sense to point it at something.
