3

One of my friends doesn't have an hdd , so I will install linux distro on a usb stick. It will be a full install just like installing to hdd but it will install on a flash stick instead of hdd. The problem here: USB 2.0 sticks are very slow , If you write a lot on it , it will wear out quickly because if have limited number of write cycles

so I want to do a full system install on a usb stick, and make it something, like read only filesystem so that any changes like installing packages will written on ram , at the end before I shutdown run a script to write all the changes on the flash drive over the old system. this is good for flash sticks because all writes are in ram and then are written to flash drive only ONCE per session when you shutdown. I think this is possible because Puppy Linux does a similar thing when you shutdown it asks you to save all the changes you made to a sfs file and it will be loaded next time you boot. I want to do the same thing but instead of the sfs file I want the changes to be written over the old system , also I don't want to run the full system on ram like puppy. I read about overlayfs and rsync , but didn't quite understand , I need some help here.

I tried the following options:

  1. install the system on flash stick and use it just like HDD ? I tried, but was painfully slow. Maybe because of the simultaneous read and writes.

  2. live CD was very fast, but the customization I made will be lost if I shutdown.

  3. live cd with persistence was very slow because changes are continuously written to the usb stick, and there's hidden services that always write logs something like that.

muru
  • 207,228

2 Answers2

1

I think you should also consider a persistent live system (with an overlay method for persistence). You can use mkusb to make it.

You can compare a persistent live system with an installed system (installed to a USB pendrive in the same way as installed to an internal drive).

It is probably a good idea to try an ultra-light flavour of Ubuntu: Lubuntu, or a medium light-flavour, Ubuntu MATE or Xubuntu. The difference is the desktop environment, and a lighter flavour will make it faster with a slow drive.

You should also consider using a fast USB 3 pendrive, even if the computer only has USB 2 ports.

See the following link and links from it:

Try Ubuntu (Kubuntu, Lubuntu, Xubuntu, ...) before installing it

sudodus
  • 47,684
1

You can still use a usb and get fast speed.

Install Ubuntu to a usb drive, then install overlayroot. overlayroot allows you to toggle booting into ram or with persistance. Persistance will be slow (like you've experienced), but booting into ram will give you speed you want.

I would use gparted to make a separate partition on the usb install so you can save documents.

Grab overlayroot and configure it so you boot into ram:

sudo apt-get install overlayroot
sudo pico /etc/overlayroot.conf

With the latter file open, page down all the way to the end. There is a pair of empty quotes. Add tmpfs between them. Then reboot.

Now you will be booting into ram each time. If you want to save things, save them on a partition on the usb or another drive. If you want to customize the user account, you must do this:

sudo overlay-chroot
pico /etc/overlayroot.conf

Page down to end of file and remove tmpfs from the quotes leaving the quotes empty: ""

Reboot and then customize user account, the turn tmpfs back on when done and reboot.


If you want to save all modifications for the user at the end you can do this to.

You have to create a user account. At the end of each live session, just:

cp -purv /home/user /media/persistant/drive/

When you boot up again:

cp -purv /media/persistant/drive/ /home/

Create the user using the command drive and make sure you use the home folder you copied over.

If you create a script it will be much easier each time.