Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to make my root system behave like a live system ?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
ahmed.alamassi
n00b
n00b


Joined: 18 Apr 2016
Posts: 2

PostPosted: Mon Apr 18, 2016 6:23 am    Post subject: how to make my root system behave like a live system ? Reply with quote

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
View user's profile Send private message
bec
Apprentice
Apprentice


Joined: 30 Sep 2004
Posts: 218
Location: Cali - Colombia

PostPosted: Wed Apr 20, 2016 2:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Wed Apr 20, 2016 4:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Apr 20, 2016 5:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1742

PostPosted: Wed Apr 20, 2016 5:41 pm    Post subject: Reply with quote

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 :roll:
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Apr 20, 2016 7:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 9220

PostPosted: Thu Apr 21, 2016 2:59 am    Post subject: Reply with quote

steveL wrote:
As I recall, he was planning to add persistence a while back.
Planned, implemented, and released.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Apr 21, 2016 9:31 am    Post subject: Reply with quote

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
View user's profile Send private message
ahmed.alamassi
n00b
n00b


Joined: 18 Apr 2016
Posts: 2

PostPosted: Fri Apr 22, 2016 4:26 pm    Post subject: Reply with quote

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 :roll:



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
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6228
Location: Room 101

PostPosted: Fri Apr 22, 2016 5:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
szatox
Veteran
Veteran


Joined: 27 Aug 2013
Posts: 1742

PostPosted: Fri Apr 22, 2016 5:30 pm    Post subject: Reply with quote

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
View user's profile Send private message
desultory
Administrator
Administrator


Joined: 04 Nov 2005
Posts: 9220

PostPosted: Sat Apr 23, 2016 3:54 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum