[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian for flash usb, external hdd or ssd



Marco Möller:
On 25.06.21 21:08, caio santos da silva wrote:
Hi Debian Team

My is Caio and I have a little idea for Debian system. My idea to you is the creation of a system exclusive for Flash USB, external HDD or SSD. Already exist the GNU/Linux Slax, such system able to install directly in a Flash USB, and its performance is really good, but it is a simple system. Thus my idea is about the creation of Debian for portables devices, which will be really interesting have a portable OS or multiples portables OS for new uses.

I hope that idea can be good for all users and new applications.

Bye.


I run my daily machine from a USB-Stick for years now without any problems. I simply installed to the USB-Stick and not to the HDD. Of course, USB3 is highly recommended over USB2. Nevertheless, USB2 does also work for me and I am also using it daily. My most important finding on system responsiveness is that minimum 2 MB CPU cache is required, and at least 3 MB is wanted. This parameter to me came out to be the most significant one to consider. Besides this, 4 years ago (I did not compare it recently) the usage of the GNOME desktop slowed down responsiveness strongly and I therefore decided for KDE Plasma which does not make me any problems on an almost 10 years old 4 GB RAM and Intel Core2Duo CPU hardware.
Good luck!
Marco
There's one additional suggestion I have for running Debian on Flash sticks, which is to turn off journaling on the filesystem. Journaling causes many re-writes to small areas on Flash memory, which at least on some Flash sticks can cause the Flash to fail much more rapidly. How rapidly the Flash cells will fail depends on how many rewrites the Flash can tolerate and how the "wear leveling" algorithm in the Flash's memory management operates.

A few Flash devices I had a few years ago (USB sticks, SD cards, CF cards, etc) didn't survive the first load of Debian onto it, after which they were unusable. One friend of mine had the same thing happen with an older SSD drive, but I haven't experienced that myself so far.

Journaling can be turned off for ext4 filesystem this way, while unmounted:
   tune2fs -O ^has_journal <device>

Checking the setting has taken is done with:
   tune2fs -l <device>

   and look that the "has_journal" option has disappeared.

If the device is a boot drive, to flip the has_journal bit requires booting some kind of "live" distro to do the task.
And that's it; just use the drive normally afterwards.

I've been using this on all filesystems on Flash media (USB sticks, SD cards, CF cards, SSD drives, including for boot drives of these types) for many years and have not run into any issues as a result so far. Crashes and power drops have occasionally caused some "normal" filesystem corruption from such an event, but so far it's always been recoverable.

I learned about removing ext4 journaling after reading Ted Ts'o suggest it. I used to use ext2 filesystem for Flash drives before ext4, because AFAIK ext3 didn't have the option of disabling the journal.

Further reading:
----------------
https://thunk.org/tytso/blog/2009/03/01/ssds-journaling-and-noatimerelatime/
https://cubethethird.wordpress.com/2018/02/05/improving-ssd-lifetime-on-linux-what-i-learned-not-to-do/

  -- Chris

--
Chris Knadle
Chris.Knadle@coredump.us
Debian Developer


Reply to: