1

I installed ubuntu 22.10 on my USB stick and then boot it, but it seems to be very slow. I use USB 3.0 and the read/write speed is more than 100MB/s, however, the system boot very slow and when running apt install or apt remove, it seems to be very slow too.

Then I tried to create a VMWare machine with the VMDK file on the USB stick and reinstall ubuntu on VMware, it runs much faster than installing the full system on USB, it is so strange. Is that the Linux USB 3.0 driver slower than windows?

I also find this: What actually slows down Ubuntu running from USB stick

Rishon_JR
  • 1,013
  • How much RAM do you have? With lots of RAM Ubuntu will run in RAM, which is much faster than SSD. Opening a program for the first time in a session and saving will of course take a little longer. (ie reading and writing to disk). https://askubuntu.com/questions/1238927/benchmark-ubuntu-persistent-usb-vs-installed-system – C.S.Cameron Dec 11 '22 at 05:41
  • Did you actually install it? or just write the ISO / squashfs system to the thumb-drive (which many people do refer to as installing it, but no installer is used; it's just written to the media in a usable form for purposes of installation), as it makes a *huge* difference. One reads data that can be acted/executed instantly; the other requires processing before it can acted-on/executed... – guiverc Dec 11 '22 at 06:20
  • @guiverc I'm sure I installed it, boot the iso then run install program, choose usb disk to install, then boot with usb. – untitled Dec 11 '22 at 07:47
  • 1
    @guiverc: I have done a bit of benchmarking. With a lot of RAM I have not found much difference in operating speed between a Persistent install on USB2 flash drive and a Full install on SSD drive. Definitely not a huge difference except perhaps when saving to disk. This is easy to confirm. – C.S.Cameron Dec 11 '22 at 11:16
  • It's not a driver issue or some kind of USB issue. It's something to do with the RAM or the BIOS. It can also be that your Hard drive could be slow(Vmware uses virtualised hard disk which is compressed, hence its faster to write) – Rishon_JR Dec 14 '22 at 11:30

1 Answers1

1

I am now fixed this problem after changing a lot of parms in this post: https://unix.stackexchange.com/questions/30286/can-i-configure-my-linux-system-for-more-aggressive-file-system-caching

Now running apt install/remove is super fast. I am not sure which parm work. I will try later. I now find it, I use zfs filesystem, when I set sync to disabled, it seens to be fast:

zfs set sync=disabled rpool
reboot

However, I don't know how to deal with ext4. On ext4 can mount with nobarrier options, and it will be fast.

  • 1
    Using ZFS on a USB stick is a really strange setup to me. – iBug Dec 11 '22 at 08:55
  • because ZFS can compress. My usb read/write speed is a little slow, I want to use more cpu to exchange IO speed. @iBug – untitled Dec 11 '22 at 10:42
  • 1
    Well, ZFS does a lot more than just compressing. Under normal operation, ZFS requires more seeking than a "traditional" FS like ext4 and XFS, but seeking is not a task an average USB stick is good at. Behind the scenes ZFS employs a sophisticated caching scheme, so it's more suitable on a server or something you run 24/7 and rarely reboot. Btrfs might do better for you but I've never used it. – iBug Dec 11 '22 at 11:04
  • 2
    Have you tried just booting the USB install toram? With 20.04 and a normal Live boot the file check took over 2 minutes on my computer, booted toram file check took less than 6 seconds. – C.S.Cameron Dec 11 '22 at 11:24