USB Partition
USB Partition
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
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
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
Thanks will get that sorted just now and report back - cheers
Michael
P.S. Pleased to see another joggler in Glasgow
Michael
P.S. Pleased to see another joggler in Glasgow
Re: USB Partition
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!)
you can also try a premade script
http://joggler.exotica.org.uk/source/sc ... zebtrfs.sh
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
http://joggler.exotica.org.uk/source/sc ... zebtrfs.sh
Last edited by BuZz on Wed Mar 16, 2011 7:14 pm, edited 4 times in total.
Reason: fixed up code
Reason: fixed up code
Re: USB Partition
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
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
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.BuZz wrote:Another option would be to "grow" the btrfs partition.
from the joggler open up a terminal and dothen reboot and open up a terminal again and doCode: 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"
http://joggler.exotica.org.uk/source/sc ... zebtrfs.shCode: Select all
sudo btrfsctl -r max /
Ta
Re: USB Partition
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
on the joggler USBDEVICE would be sda
I have fixed up the code in the previous posts. It wasnt quite correct sorry.
[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
I have fixed up the code in the previous posts. It wasnt quite correct sorry.
Re: USB Partition
Thanks, all working now.
EDIT - when I rebooted & entered "sudo btrfsctl -r max /" I got an error message "ioctl:: Invalid argument"
EDIT - when I rebooted & entered "sudo btrfsctl -r max /" I got an error message "ioctl:: Invalid argument"
Re: USB Partition
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.dwl99 wrote:Thanks, all working now.
EDIT - when I rebooted & entered "sudo btrfsctl -r max /" I got an error message "ioctl:: Invalid argument"
-
- Posts: 10
- Joined: Wed Mar 16, 2011 5:48 pm
Re: USB Partition
What do you mean by try it on another machine ?
Re: USB Partition
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.
-
- Posts: 10
- Joined: Wed Mar 16, 2011 5:48 pm
Re: USB Partition
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
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
-
- Posts: 10
- Joined: Wed Mar 16, 2011 5:48 pm
Re: USB Partition
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
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
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.
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.
-
- Posts: 10
- Joined: Wed Mar 16, 2011 5:48 pm
Re: USB Partition
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
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: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 ?
Code: Select all
wget http://joggler.exotica.org.uk/source/scripts/resizebtrfs.sh
Code: Select all
chmod +x ./resizebtrfs.sh
Code: Select all
./resizebtrfs.sh
In fact, you'll probably need to do this as a superuser, as you're messing with partitions:
Code: Select all
sudo ./resizebtrfs.sh
BirdsLikeWires - Get fresh builds of Debian Bullseye, Bookworm, and Trixie for OpenFrame with the latest 5.10, 6.1, and 6.12 kernels! 

-
- Posts: 10
- Joined: Wed Mar 16, 2011 5:48 pm
Re: USB Partition
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.

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
Awesome.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.![]()

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

BirdsLikeWires - Get fresh builds of Debian Bullseye, Bookworm, and Trixie for OpenFrame with the latest 5.10, 6.1, and 6.12 kernels! 
