You are not logged in.
liveroot is a mkinitcpio hook. You need to add it to /etc/mkinitcpio.conf. You then activate it on the kernel cmdline.
Offline
well I meant is there no tutorial or written documentation for how do you liveroot? if there is not and I manage to get it working I would not mind writing up a small guide and posting it on the arch Linux forums.
Cya At The Table
Offline
Well... I am the creator of liveroot, so what are you having issues with?
Offline
I'm going to have to get back to you on that. I'm still trying to figure out what I'm doing wrong. I cant work with it at the moment as I'm currently overseas with a borrowed laptop. Just backed up my system to a single partition usb so I can but windows back on the laptop before I return it. I will have to go through the process again once I reinstall arch to my laptop.
Cya At The Table
Offline
Yes I would need more of a step by step write up to before I would be confident to try it.
You can like linux without becoming a fanatic!
Offline
Install liveroot (if you have a changing system, use the normal hook).
Add "oroot" to /etc/mkinitcpio.conf hooks() .
Add oroot=<option> in your kernel cmdline:
oroot=live | load rootfs into zram lzo compressed block. Read/write from zram block
oroot=raw | use tmpfs for write
oroot=compressed | use zram lzo compressed block for write
If you want to write back, run overlay_flush. There are also examples in /usr/share/liveroot
Offline
I installed liveroot and enabled it according to the instructions. However, I don't seem to have function /usr/bin/overlay_flush. How do I make it available?
The difference between reality and fiction is that fiction has to make sense.
Offline
I installed liveroot and enabled it according to the instructions. However, I don't seem to have function /usr/bin/overlay_flush. How do I make it available?
Did you add oroot=<something> to your kernel cmdline?
Offline
Yes, oroot=compressed. Should I further try other oroot=live or oroot=raw?
The difference between reality and fiction is that fiction has to make sense.
Offline
Yes, oroot=compressed. Should I further try other oroot=live or oroot=raw?
Is oroot added to hooks() in initcpio?
Offline
It is. Problem vent away when I switched systemd hook to base and udev hooks. Is it possible to get liveroot working with systemd hook?
Last edited by Chrysostomus (2015-09-22 05:22:01)
The difference between reality and fiction is that fiction has to make sense.
Offline
@Bluerider, I install liveboot from aur to my usb key system j,and compile kernel, change hooks and modules in initcpio conf file, seems it works fine. thanks a lot.
But I found there is problem if I try to run some command (like fdisk ...) when I pull out the usb key, I assume that everything should load into ram, that means I could pull out the usb key after the system powered on.
Should I do something or liveboot is not design like I thought ?
Offline
Hi,
great, it work so far. I use liveroot to avoid Disk I/O @ my homeserver and last but not least looking forward to a faster user experience. The zram0 image is about 4.6G with all extras i need so far.
My goal is to have a bootstick for the worst case scenario. But there are other usecases for liveroot.
Since there is noting about liveroot on the net i have a couple of questions.
What about critical services like mysqld. What happens exactly during overlay_flush?
Is it possible to flush from another rootfs to usb?
Can the fs grow out of partition limits in ram?
Why getting this systemd-remount-fs.service failure?
Thank you in advandce
Last edited by Schlunze (2015-12-02 19:49:39)
Offline
[...]
Since there is noting about liveroot on the net i have a couple of questions.1a. What about critical services like mysqld.
1b. What happens exactly during overlay_flush?
2. Is it possible to flush from another rootfs to usb?
3. Can the fs grow out of partition limits in ram?
4. Why getting this systemd-remount-fs.service failure?
Numbering by me.
I am currently planning on something of the same as you (a live usb rescue stick). I just happened to run into this thread, luckily it looks like the first questions can be easily answered with a little research;
1a. If these services are critical (and writable) for you: DON'T USE A RAM FILESYSTEM.
If it's only/mostly read-access, you should be fine. MySQL/Mariadb do a lot of work to keep your data safe. Storing the the database in RAM says that your data isn't all that critical.
With my apologies for the caps, but this can't be stressed enough imho.
1b. What happens during overlay_flush is exactly:
rsync -ax --delete --no-whole-file --inplace \\\$PWD/ /run/oroot \\
--exclude boot --exclude dev \\
--exclude mnt --exclude proc --exclude run \\
--exclude sys --exclude tmp --exclude usr/bin/overlay_flush;
(from https://github.com/bluerider/liveroot/b … r/compiler)
2. I don't see why not, as the flush is basically a copy operation.
3. Theoretically: yes. I personally haven't tested this, but as far as I can tell, the overlay is just another filesystem. Do you really have partitions smaller then your RAM?
4. Appears to happen only when you enable the systemd hook in mkinitcpio.conf.
Hope that helps.
Last edited by ghs (2016-02-08 21:24:05)
mvg,
Guus
Offline
For the btrfs options; how about including support for snapper if it is installed?
This would only kick in during overlay_flush operations on a btrfs root fs, but could be really useful to keep the number of snapshots (and thus the maintenance of the filesystem) low.
Specifically, i'm thinking about building a USB rescue stick which can be updated from time to time.
mvg,
Guus
Offline
Have some trouble get the package running.
I did all the steps described, but when I start up the system - Arch kernel version 4.1.3-1 - the system hangs with the following output:
modprobe: FATAL: Module zram not found.
zramctl: no free zram device found.
mount: wrong fs type, ....... after that the system hangs completely.
When I run modprobe zram manually from the shell (booted with a disk configuration) I can generate afterwards a zram disk using zramctl witout any problems.
Is the package not capable of running with my recent kernel ?
I have 6GB of RAM and my root fs is approx 2 GB in size.
Any ideas, what I'm doing wrong ?
Here my Configuration:
a grub.cfg extract
----------------------------
menuentry "ArchLinux ram" {
set root=(hd0,2)
linux /boot/vmlinuz-linux root=/dev/disk/by-uuid/420791c7-5259-4169-bbaa-d3f8a4394a76 oroot=live ro quiet splash
initrd /boot/initramfs-linux.img
}
---------------------------
the proper oroot scripts reside in /usr/lib/intcpio/hooks and /usr/lib/initcpio/install and have the same permissions as all the other scripts in there
Offline
Hi all,
finally I got it working.
I think the key thing was, that it is required to run the command "mkinitcpio -p linux" after modifying /etc/mkinitcpio.conf to re-create the initramfs-linux.img that will be loaded at boot time.
@bluerider: Many thanks for this great piece of work. However it took me some hours of struggling with the little documentation spread over different locations.
Imho: If you want this nice package spread more widely, you need to invest time in documentation. I agree to some other users in the forum, a step by step documentation along with a clear description of the concept and some background information would be of much help.
Offline
Hello
I find this work very useful interesting, not just for USB Stick, I've tested on a embedded devices also and it works great to protect filesystem from power loss.
The only thing a I miss is a way to update grub2.
Once liveroot is activated, overlayFS avoid grub2 upgrades.
And the only way I found to update grub configuration is reboot and manually comment oroot= option.
Is there any remote way to deactivate liveroot to allow system upgrades?
Thank you.
Offline
Hello Taorg,
anything you change on the live overlay file system can be written back to the source file system by using the "flush_overlay" command.
Just run the command and any update will be written back.
flush_overlay comes along with liveroot
Regards
zimbral
Offline
Hello taorg,
I meant overlay_flush, not flush_overlay ....
zimbral
Offline
Hello zimbral
Yes sure, you can flush every change you do, but not every program is ready or aware to work with overlayfs.
Here is an example
sudo grub-mkconfig -o /boot/grub/grub.cfg
/usr/bin/grub-probe: error: failed to get canonical path of `oroot'.
That's why I would like to switch off liveroot, just for system upgrades, where grub2 config is needed.
Thanks
Offline
Hello again,
I think an easy and clean solution, could be a command oroot-chroot:
A chroot to access the oroot lowerFS and execute system maintenance.
It could be nice Bluerider or somebody with sufficient skills would like the idea (Ubuntu distro has similar solution) and add this command.
Thank you very much
Offline
Hello again,
I think an easy and clean solution, could be a command oroot-chroot:
A chroot to access the oroot lowerFS and execute system maintenance.
That's a good idea; I'll look into it. Can folks list out the errors in a single post?
Offline
Well, the issue #14 struck. My system is dead. Is Bluerider still maintaining this? I'll mark the AUR package as orphan, just in case.
Offline
Could someone help out with refactoring this, fixing some bugs and adding more documentation? The original author seems to rarely be online so he's not much help, sadly.
I am not as versed in Bash's nuances as I should be for this project so that kinda slows me down, but if someone more experienced could take a look it would be greatly helpful.
Offline