Page 1 of 1

Xubuntu can't fit on new USB key, so...

Posted: Thu Jan 24, 2013 10:55 pm
by Leonardo
...I did a workaround
I have a USB stick big enough to be filled with a 4GB image.
Yesterday I got the Emtec S100 that is a little bit less than 4GB so the images xubuntu and others give me an error like: not enough space.
I think: where's the problem, the filesystem occupation is really more little than 4GB so the "missing" data should are null... infact... no way to boot :(
so I did this:
fdisk to create needed partitions on the "little" stick (I didn't create the swap, is a suicide to have swap partition on flash drive!)
the first partition is a FAT16, 250MB, the second is a classical linux partition.
then I format the partitions with:
mkfs.vfat -n linux-boot /dev/sdb1
mkfs.btrfs -L linux-root /dev/sdb2

(always pay attention to devices!!!)

the options -L and -n allow me to create a label name.

after this I inserted the "original" usb key and I did a rsync to copy all the files preserving permissions and extended attributes with the command:

rsync -avzp /media/linux-rootSOURCE /media/linux-rootDESTINATION

the same for linux-boot

a tip:
if you use Ubuntu it mounts automatically on /media with the labelname so the root partition, called linux-root will be mounted on:

/media/linux-root

inserting a second key, with the same label, the partition will be mounted on /media/linux-root_
please notice the _ at the end!

so also in this case, please pay attention to SOURCE and DESTINATION!!!

it will take about 15 minutes and at the end you will have a nice copy of the contents of the original key.

now you can umount the volumes and test the new key inserting in on the Joggler crossing fingers :)

I had no problems and worked at the first time, I have ONLY one problem:
the BTRFS image should have compressed binaries... the problem I found is on the destination I lost compression, infact the original is less the 1,5GB (I removed a lot of garbage I didn't need), and the destination is more than 2GB!!!
If you don't consider this, everything is ok!

Re: Xubuntu can't fit on new USB key, so...

Posted: Thu Jan 24, 2013 11:05 pm
by Leonardo
Ok maybe I found my error... it seems I didn't use a correct option during the mkfs.btrfs! I'm investigating :)

Re: Xubuntu can't fit on new USB key, so...

Posted: Fri Jan 25, 2013 2:38 am
by BuZz
Compression is a mount option. See btrfs wiki.

Re: Xubuntu can't fit on new USB key, so...

Posted: Fri Jan 25, 2013 9:25 am
by Leonardo
Thanks BuZz, got it!

Re: Xubuntu can't fit on new USB key, so...

Posted: Sat Jan 26, 2013 10:03 am
by Leonardo
Thanks BuZz I investigate on btrfs filesystem and I found that I have to mount with the compression options, so if you want to have compressed FS copying files you have to mount it manually with the command:

mount -t btrfs -o compress=lzo /dev/DEVICE /mnt/

after this with mount command you can confirm is mounted compressed and, copying files, you will use the same space of the source.

Re: Xubuntu can't fit on new USB key, so...

Posted: Sat Jan 26, 2013 2:33 pm
by BuZz
the script I use to generate the images can be found here - http://joggler.exotica.org.uk/source/sc ... keimage.sh - might be of use - it can for example be used to make smaller images.

Re: Xubuntu can't fit on new USB key, so...

Posted: Sat Jan 26, 2013 2:50 pm
by Leonardo
BuZz I see only now the images on exotica are yours!!! I'm a noob :D
So good job and thanks!!!