You are not logged in.

#1 2014-10-31 09:47:01

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

[solved] Filesystem for OS on a slow USB stick

I am making an emergency OS usb stick out of SanDisk Fit. It is great because it's tiny, but it is also very slow.

What filesystem would be best for the OS installed on such slow medium? I narrowed it down to those three, but am open to suggestions if there's something better:

➤ BTRFS with zlib compression - because data written is compressed and hence there is less of it to write
➤ ext4 with disabled journaling - because it has no journalling
➤ f2fs - because it is designed for flash devices


I already installed a system with BTRFS lzo/zlib, but if I install a package and try to use a browser, the system becomes partially unresponsive, which I suppose is the fault of overloaded I/O of the usb stick.

Would another filesystem make things better?

Last edited by Lockheed (2014-11-03 14:29:06)

Offline

#2 2014-11-02 02:30:06

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 195
Website

Re: [solved] Filesystem for OS on a slow USB stick

If it's an emergency USB stick then I guess you won't be using it very often, perhaps only for recovery, so perhaps it doesn't matter?

If it's not for recovery and for when you need Linux somewhere you can't get it, I would tend to go with ext3/4 so that if anything goes wrong and you need to recover data, you can do so from pretty much any other Linux PC.  If you use something like f2fs, you might find data recovery difficult if you are stuck on an old machine with no support for that filesystem.  But since ext3 is pretty much everywhere, it would be much easier to mount the USB stick on another machine and do repairs.

If you are worried about speed, then maybe instead you could tune the kernel to have a very large I/O cache so most of the disk activity happens in RAM, and it only gets flushed out to the USB stick later as the stick can keep up.  That way all your I/O completes quickly and programs are responsive, then later when you are not doing any I/O the data is slowly being written out to the USB stick in the background.

I think the filesystem won't make much difference in this case.  If you use a compressed filesystem and get as high as 50% compression (very unlikely), you may double your speeds, but it sounds like even double will still be very slow.  The other differences between filesystems will probably not make enough of a speed difference to be noticeable, as they will all stuffer from the same bottleneck - if your USB stick can only write at 1MB/sec and you try to write 50MB of data, it's going to be slow no matter how your filesystem arranges the data.

Offline

#3 2014-11-02 08:36:51

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,957
Website

Re: [solved] Filesystem for OS on a slow USB stick

It should be noted  that usb sticks generaly have hard time reading/writing many small files and a linux installation mainly consists of many small files. Your better chance is to build a live cd that uses squashfs which is a one large file that contains your entire filesystem compressed and usb sticks have no problem reading a single large file. This is why live isos work so well on usb sticks.

Offline

#4 2014-11-03 14:28:50

Lockheed
Member
Registered: 2010-03-16
Posts: 1,550

Re: [solved] Filesystem for OS on a slow USB stick

Thanks to everyone who answered.

I ended up going for BTRFS with compress-forece=lzo.

Also, I used Profile-sync-daemon and Anything-sync-daemon to put the following folders in ramdisk:
/var/log
/var/tmp
/home/user/.cache/ - (I have yet to test this one)
and the browser profile for firefox.

Results:
It works very well, smooth. Boots to desktop (MATE) in several seconds. Programs load nearly instantly. Very rarely do I get any momentarily lockups.
This is a much better experience then previous installations I've done on a flash drive.

However, this experience is based on only an hour of tests.

Additionally, I set up Grub2 to chainload to E2B bootloader to easily boot any live ISO I put on sda1 fat32.

I am content with this setup. The only thing left to do is to setup encryption of the home folder.

Offline

Board footer

Powered by FluxBB