Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 39236  / 1 Year ago, fri, november 18, 2022, 10:57:50

First thing, I wanted to make sure, there is an understanding what this post is NOT about:





What I am looking to do is to have a home NAS (file) server that boots from a USB stick or CF card. It is irrelevant for the point of this post how the flash drive is connected (USB, IDE, some other way), what is relevant: I want to have an entire operating system installation boot and run from flash drive. The reasons I want specifically this type of installation is: I want to be able to easily make a backup copy of operating system (image the flash), I want to make sure I can swap operating system instantly and boot it (by replacing flash drive), and I want drives on a file servers be replaceable separately from OS.



I am aware that it is possible to simply format flash drive as ext2 and install on it. What I am looking for is recommendations for creating more robust solution. Here are a few items I am looking to do:




  • configure root partition as YAFF2, or LogFS, or as some other file system designed specifically for flash drives.

  • reconfigure the base OS to minimize writes (ramfs in /tmp and such)



Please submit your recommendations. I wonder if Ubuntu is even applicable for such scenario really...



I want to clarify my goal a little bit. The regular SSD drives feature firmwares that will keep the drive alive for a long time by using tricks, such as: constantly reallocating writes to new sectors. USB sticks have no such firmware, so using regular file system could kill them fast. I am looking if it is possible to emulate SSD firmware by using file system designed for flash. In a sense, I am trying to make it so that USB drive could run a system in a normal fashion, as if it was an actual SSD.


More From » server

 Answers
7

Use LVM.
In this case you can use snapshots - instant clones of your system, so you can easily copy entire system or just migrate it between flash drives*.



And if you'd like to have sort of "Wear-leveling", you can use aufs for root file system on usb flash. So you don't have to use YAFF2 etc, ext4 will be fine.



*But /boot you will always need to copy manually + you will need to modify grub/disk's UUID. You will need rescue CD in case to resize root volume to the size of USB Flash. And in case you will broke grub read this manual.



I wrote the manual for that.


[#40844] Saturday, November 19, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
igeonlothe

Total Points: 370
Total Questions: 121
Total Answers: 114

Location: United States Minor Outlying Island
Member since Fri, Feb 5, 2021
3 Years ago
;