View previous topic :: View next topic |
Author |
Message |
ahmed.alamassi n00b
Joined: 18 Apr 2016 Posts: 2
|
Posted: Mon Apr 18, 2016 6:23 am Post subject: how to make my root system behave like a live system ? |
|
|
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 is usb 2.0 stick are very slow , If you write a lot on it , it will wear out quickly because if have limed 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 puppylinux does a similar thing when you shutdown it asks you to save all the changes you made to a sfs file and it will 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 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.
you may ask why I didn't the following options ?
1- install the system on flash stick and use it just like hdd ? tried that it was painfully slow maybe because of the simultaneous read and writes.
2- live cd ? tried it , it was very fast , but the customization I made will be lost if I shutdown.
3- live cd with persistence ? it also was very slow because changes are continuously written to the usb stick , and there's hidden services that always write logs something like that. |
|
Back to top |
|
|
bec Apprentice
Joined: 30 Sep 2004 Posts: 220 Location: Cali - Colombia
|
Posted: Wed Apr 20, 2016 2:45 pm Post subject: |
|
|
Gentoo is cool for many use cases, but what you are trying to do is easier with other distributions like Puppy or slax:
http://puppylinux.com/
http://www.slax.org/ _________________ abe |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Apr 20, 2016 4:04 pm Post subject: |
|
|
bec wrote: | Gentoo is cool for many use cases, but what you are trying to do is easier with other distributions like Puppy or slax: |
... or Alpine Linux.
best ... khay |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed Apr 20, 2016 5:12 pm Post subject: |
|
|
If you must do it with Gentoo, ask likewhoa in #gentoo-ten on IRC: chat.freenode.net or .org for help; the liveDVD is made for USB usage with dd.
As I recall, he was planning to add persistence a while back.
I'd advise Puppy, or w/e others say, in preference, mind. |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3151
|
Posted: Wed Apr 20, 2016 5:41 pm Post subject: |
|
|
Yes, you can dump changes to a file during shutdown and load them when you boot.
You can even squash the static part (good for both, read performance and space efficiency) and compress dynamic image. Depending on the way you handle it, it will work faster/slower and take more/less space and be more/less affected by RAM constrains.
I think I'd go with AUFS (Note: you need a kernel that supports this), adding new branches (and bundles) as the time goes and flattening the stack now and then. Usually "then" I guess |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Wed Apr 20, 2016 7:40 pm Post subject: |
|
|
It's because this is for a friend, that I recommend a minimal bindist.
I've always had a soft-spot for Puppy, but I'm interested to hear what others use (so far: Alpine and Slax.) |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Apr 21, 2016 2:59 am Post subject: |
|
|
steveL wrote: | As I recall, he was planning to add persistence a while back. | Planned, implemented, and released. |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Thu Apr 21, 2016 9:31 am Post subject: |
|
|
Ahh, thanks, desultory. :-)
Dunno how I missed that sticky, but that is good news.
So, ahmad, you can use a LiveDVD to do it with Gentoo. |
|
Back to top |
|
|
ahmed.alamassi n00b
Joined: 18 Apr 2016 Posts: 2
|
Posted: Fri Apr 22, 2016 4:26 pm Post subject: |
|
|
szatox wrote: | Yes, you can dump changes to a file during shutdown and load them when you boot.
You can even squash the static part (good for both, read performance and space efficiency) and compress dynamic image. Depending on the way you handle it, it will work faster/slower and take more/less space and be more/less affected by RAM constrains.
I think I'd go with AUFS (Note: you need a kernel that supports this), adding new branches (and bundles) as the time goes and flattening the stack now and then. Usually "then" I guess |
thanks szatox , you are the only one who understood me , I will not install gentoo on the usb stick , I just asked gentoo forums because gentoo users are geeks and have good knowledge.
I don't want to use puppylinux , I'd like a more complete distro like debian or fedora.
Quote: | "I think I'd go with AUFS " |
is there an easy tutorial for that ?
we can make it simpler , forget the squash part and the part about dumping changes to a file.
instead , Can I use something like rsync during shutdown to write the changes over the old system ? |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Fri Apr 22, 2016 5:16 pm Post subject: |
|
|
ahmed.alamassi wrote: | [...] I will not install gentoo on the usb stick , I just asked gentoo forums because gentoo users are geeks and have good knowledge. I don't want to use puppylinux , I'd like a more complete distro like debian or fedora. |
ahmed.alamassi ... in which case you should ask on the debian, fedora, or any of the general linux support, forums.
best ... khay |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3151
|
Posted: Fri Apr 22, 2016 5:30 pm Post subject: |
|
|
Quote: | Can I use something like rsync during shutdown to write the changes over the old system ? | I'm pretty sure you can, but there is no point in doing this. Linux is good at caching hard drive in RAM, so you will get better performance _NOT_ creating that ramdisk, and as a bonus, you will not have to wait before shutdown.
Making it work like a liveCD only makes sense if it's to be used like livecd. Putting it on an USB stick is a good use case as it lets you deal with space constraints, low bandwidth, and finally: wearing down the medium every time you write anything.
If you want to run it from a (fast) hard drive, you can still squash your filesystem and append the changes, but it's actually more of making art than something useful. Oh, and overlayfs would be enough in this case.
AUFS tutorial? Get a kernel that supports it, mount parts of the filesystem to some directorires, and then mount aufs with type aufs and branches in options on top of your root. I suppose you'll find all the tricks here: https://forums.gentoo.org/viewtopic-t-465367.html
Not exactly your use case, and it starts with older unionfs, but it's close enough.
Still.. Really, don't do that on a regular drive. You would not gain anything but experience of doing it. |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sat Apr 23, 2016 3:54 am Post subject: |
|
|
ahmed.alamassi wrote: | thanks szatox , you are the only one who understood me , I will not install gentoo on the usb stick , I just asked gentoo forums because gentoo users are geeks and have good knowledge.
I don't want to use puppylinux , I'd like a more complete distro like debian or fedora. | You had left open the prospect of a Gentoo install for your purpose, given that you have made it explicitly not an option, this should be relocated to Unsupported Software or Off the Wall.
Moved from Other Things Gentoo to Unsupported Software; though if you would prefer Off the Wall, just ask. |
|
Back to top |
|
|
|