Optimize an Arch install on a USB 3.0 flash drive?
I have Arch installed to a Lexar P20 32GB and was wondering what can be done to make the experience better.
I have it in a 3.0 port, 512MB FAT32 boot, rest of it partitioned as EXT4. I do have noatime set in fstab. Runs mostly ok but has the occasional freeze up especially when running Firefox.
Would switching to F2FS maybe help, and is there anything else I can do even on the EXT4 install to stop the lockups?
EDIT: To the person(s) that keep downvoting posts, why? I see a ton of legitimate posts that are just sitting at 0.
Edited 12 May 2016. We only hold this version.
About this post
- Posted
- Archived
- Edited
- Score
- 56 · 100% up
- Kind
- Text
- ID
- 4j1daq
47 comments
Well, F2FS from my experience on ssd grants an improvement worth switching. Also you could try (if you haven't tried already):
Adressing the firefox problem, are you sure you are not running out of RAM?
Generally speaking, having OS on USB 3.0 pendrive is obviously going to bottleneck it unless your pendrive has over 100 MB/s read/write.
P.S. Your boot partition is too big. If you are not using multiple system images you can shrink it to 256 MB (that's safe for me) or even something around 128 megabytes.
Might I suggest setting your Firefox to use a RAM cache instead of having it cache to the USB stick.
Wow, I thought it is set by default...
Huh, I might have to try this. Any clue if it's doable on my Windows partition as well?
That's what I was thinking pertaining to F2FS. I'll redo the stick later and try it out.
Yeah the Firefox issue is just little lockups probably due to the IO bottleneck.
This is more of a portable drive so I left it as 512 so I could have a little storage accessible on Windows.
Thanks for the suggestions.
EDIT: Turns out Windows refuses to mount the FAT32 partition. I even tried in diskpart and it just spits out something about not being able to assign a removable disk.
IIRC windows will refuse to mouth efi partitions
I see a lot of people saying that f2fs is either not really built for SSDs or doesn't give much benefit on them. Have you noticed otherwise?
Considering some benchmarks, f2fs is a bit faster than ext4 on ssd. Also it hands down conserves ssd's better by just not caching as much data as ext4 to extend live of ssd's sectors.
After trying many Flash drives, the one that stands above all is SanDisk Extreme 32GB USB 3.0 Flash Drive (SDCZ80-032G-GAM46)
I run Arch on one, and Fedora on another. I am extremely happy with the performance of both. No freezes, no slow shutdowns or startups, apps start quickly. I've run both gnome and i3. Pacman and dnf updates absolutely fly. I run Firefox and chrome well. IMO, they are obviously better performing than a spinning disk, and compete with SSD's, in my experience. I saw transfers speeds of 100MB/secs write and 200MB/sec reads, which of course vary by file sizes, etc.
I use EXT4, plugged into a USB 3 port on my 16GB T440p, with grub on the USB. Few other optimizations.
I would try this disk; it's pretty cheap to find out.
Good luck.
The drive I picked up was hitting 275MB/s raw read (dd to /dev/zero) Pretty happy with it so far.
Really?
I don't know what to think. Arch flies on mine with no tweaks.
Deleted before we saved it.
I can't answer the actual question as I've never delved into that, but I can answer your edit: The RES calculates vote-statistics, you're lazy (we all judge) or have some issues with reading (I don't judge. I got friends with reading disorders).
Any post that has negative votes automatically shows 0. However, when opening a post, I can see "X points (Y% upvoted), Z votes". I assume that's RES-specific though.
Well vote-fuzzing doesn't go into effect until more votes, as far as I'm aware. I saw 0 with 50% upvoted which means I was downvoted at least once. It doesn't really make any difference to me. It just starts to bother me when I see a lot more posts on this subreddit like that.
Do you see total votes? Because that's an issue. 50% basically means 0. You're creating a post, and your upvote is automatically attached to that. Someone downvotes that, and now you're at 0, or 50%. For example, your post has 19 points (85% upvoted), 27 votes (right now).
...
Well this is fun. Apparently the RES plugin keeps a tally. I can see any number of points that isn't negative, and I can see a percentage, but not the number of votes. So, RES keeps vote statistics, otherwise some posts would be in the negative hundreds.
Another option instead of F2FS might be Btrfs with inline compression, since inline compression will reduce read/write.
you can also change the scheduler to blk-mq. I've had pretty good results with it.
I went down this route for about a month. Tried everything in the book, and was not really satisfied with the results. Its funny I even see this post. I was scrolling through my front page as i was contemplating just erasing the drive.
Truth be told, it just seemed like if i used it fora while it was fine. But after the system was on for awhile, idle. It would just be junk afterwards.
I had the same lockup problem. I turned off journaling and the lockups stopped. Everything ran much smoother.
Disabling/moving swap will likely make a huge difference. Firefox loves paging to disk, and a flash drive will not take that well.
That's not how swap works. Swapping is done by the kernel, which Firefox can't influence. Swapping only takes effect when the system is out of memory and programs would otherwise be forcibly terminated.
Actually didn't even create a swap. Most if not all of the computers I will use this on are 4GB+.
Then the only possible problem remaining is you're using Firefox :D
Use a real hard drive?
And I didn't downvote you - but some of them might be from your post title. There isn't really anything to 'optimize'. If you use a USB drive for this, it's going to have some problems.
USB 3.0 is fast for large, 'solid' file transfers, but for many small files - like an operating system - you're going to have some delays with random read/writes.
Cache as much as you can in RAM, especially Firefox.
I built this install as a "boot on everything, do anything" kind of thing. Works on BIOS/EFI and I loaded down with a bunch of tools in case any of the computers on the floor (work at a callcenter) go down. Considering its use, the lockups aren't as big of a deal but I was just trying to see what all could be done. I see the Firefox on RAM also mentioned above. Will give it a shot, thanks!
EDIT: Wow, profile-sync-daemon completely eliminated the lockups in Firefox. So yeah the caching was killing the performance.
How did you get it to work on BIOS/EFI? Are you using x86 or x64?