USB Partition

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: USB Partition

Post by gegs »

I've run the above script to resize a 16GB stick and when I check in Gparted, the btrfs partition has indeed filled the empty space. However, when I boot using the resized stick, the disk utility tells me there is only 3.2GB total file system capacity and only 658MB available. I am also getting disk space warnings.

Any ideas why the whole btrfs partition isn't being recognised?
Jonathan Bowley
Posts: 19
Joined: Mon Mar 28, 2011 1:37 am
Location: Huddersfield, UK

Re: USB Partition

Post by Jonathan Bowley »

having the same problem here only on a 500gb hdd. resized to 500gb but showing as 3.2gb with 24mb free space. keep getting free space warnings too. am puzzled.
User avatar
dwl99
Posts: 765
Joined: Fri Mar 04, 2011 7:38 am
Location: Glasgow

Re: USB Partition

Post by dwl99 »

I followed the instructions too & got the same result. I thought it was just me being too stoopid to follow instructions. In the end I just changed to the ext4 version & used gparted on another linux machine to resize it.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: USB Partition

Post by gegs »

Would it be feasible to write the ext4 image to a USB stick, resize the partition using Gparted to fill the empty space, then use the 'btrfs-convert' tool to convert it to btrfs?

As mentioned above, resizing the btrfs partition appears to work (from a Gparted perspective) but the Disk Usage Analyser still shows the unresized partition properties - and there are copious warnings about the root filesystem being almost out of space. Is there a config file somewhere that needs editing before the full btrfs partition is available?

I don't know much about btrfs and any help would be appreciated.
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: USB Partition

Post by BuZz »

Jonathan Bowley wrote:having the same problem here only on a 500gb hdd. resized to 500gb but showing as 3.2gb with 24mb free space. keep getting free space warnings too. am puzzled.
Looks like the resize isn't complete. I resize the btrfs partition on 4gb sticks to fill the space on 8gb and the free space is correct. there could still be some free space issues with btrfs, but it still should show the free space correct after the initial resize etc. you did resize both the partition (when not mounted), then the underlying btrfs (while it is mounted) ?

could I ask you try it again and paste the output from my resize tool. Please use a recent linux release to do it. Ubuntu natty live cd would suffice.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: USB Partition

Post by gegs »

BuZz wrote:Looks like the resize isn't complete.
So, if I have this right, I need to resize the partition using 'sudo ./resizebtrfs.sh /dev/sdb' - sdb being the unmounted device I want to resize.
After doing this I need boot from the device with the resized partition and run 'sudo btrfsctl -r max /'

I think I missed out a secondary step because this thread seems to imply that the shell script will do it all.
Last edited by gegs on Tue Apr 05, 2011 1:53 pm, edited 1 time in total.
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: USB Partition

Post by BuZz »

using resizebtrfs.sh you dont need to do anything apart from that command. it resizes the underlying partition, then mounts and resizes the btrfs to fill the larger partition. shouldn't need anything else. not saying there may not be bugs mind ;-)
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: USB Partition

Post by gegs »

BuZz wrote:using resizebtrfs.sh you dont need to do anything apart from that command. it resizes the underlying partition, then mounts and resizes the btrfs to fill the larger partition. shouldn't need anything else. not saying there may not be bugs mind ;-)
As I think my posts and another couple illustrate, this isn't happening as it should. The btrfs partition does fill the unused space but it is not recognised as the root file system (hence the out of space errors and erroneous disk capacity info on 'disk usage analyser')
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: USB Partition

Post by BuZz »

btrfs has a number of "space" related issues, some of them quite complicated. Also information given on disk usage analyzer may not be actually 100% correct - https://btrfs.wiki.kernel.org/index.php ... ts_left.21 and https://btrfs.wiki.kernel.org/index.php ... e_space.3F

To give some more advice, I need real numbers/data to look at, such as the output from

btrfs fi df /

df -h

parted /dev/device print
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: USB Partition

Post by gegs »

Thanks Buzz, I'll check this out when my Joggler is at hand.

I suspect you're right that the system is just misrepresenting the size and available space of the system volume because Gparted can see it no problem.

Strangely enough, this is only a problem with my USB stick. I created a FAT32 partition towards the end of a portable hard disk installation and resized the preceding (non-compressed) btrfs partition to 50GB. The disk usage analyzer doesn't misrepresent the available space and I've never had root file system 'out of space' error messages.
jpearn
Posts: 17
Joined: Thu Mar 10, 2011 11:38 am

Re: USB Partition

Post by jpearn »

I had problems with the script also resizing on an Ubuntu 10.10 install but it turned out I didn't have btrfs-tools installed, after this all is good, thanks !
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: USB Partition

Post by BuZz »

yeh it needs btrfs-tools and also parted.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: USB Partition

Post by gegs »

Being curious, I downloaded the 1.9 image and resized it using the shell script - and the full btrfs volume is now recognised. Fantastic!
User avatar
BuZz
Site Admin
Posts: 1460
Joined: Fri Mar 04, 2011 1:15 am

Re: USB Partition

Post by BuZz »

Joggler Gremlins!
Post Reply