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

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
User avatar
Leonardo
Posts: 146
Joined: Tue Dec 25, 2012 10:51 pm

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

Post 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!
User avatar
Leonardo
Posts: 146
Joined: Tue Dec 25, 2012 10:51 pm

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

Post by Leonardo »

Ok maybe I found my error... it seems I didn't use a correct option during the mkfs.btrfs! I'm investigating :)
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

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

Post by BuZz »

Compression is a mount option. See btrfs wiki.
User avatar
Leonardo
Posts: 146
Joined: Tue Dec 25, 2012 10:51 pm

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

Post by Leonardo »

Thanks BuZz, got it!
User avatar
Leonardo
Posts: 146
Joined: Tue Dec 25, 2012 10:51 pm

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

Post 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.
User avatar
BuZz
Site Admin
Posts: 1462
Joined: Fri Mar 04, 2011 1:15 am

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

Post 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.
User avatar
Leonardo
Posts: 146
Joined: Tue Dec 25, 2012 10:51 pm

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

Post by Leonardo »

BuZz I see only now the images on exotica are yours!!! I'm a noob :D
So good job and thanks!!!
Post Reply