SliTaz SliTaz Forum

You are not logged in.

#1 2012-09-21 11:06:57

xjjx
Member
Registered: 2012-09-21
Posts: 17

HDD Install read-only

Hi all,

I'm curious is it possible to install Slitaz on HDD in read-only mode? I mean something like https://sites.google.com/site/linuxpendrive/rorootfs

Let me explain why I think that I need this. I want to make firmware-like system to my mini-PC, which I use to play music on stage using VST instruments and FSTHost (http://fsthost.sourceforge.net/) app. Actually - I'm the maintainer of this soft ;-) I need small, easy to restore distro. Slitaz USB could be good choice - but it load entire system to RAM.

So, what do you think - will take much work for install Slitaz in RO mode ?

BTW. When (if) I learn more about how to make package I probably made package for FSTHost - I can even maintain it if like.

Offline

#2 2012-09-21 13:20:54

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: HDD Install read-only

Hi Paweł,

Let me ask you, what happened if you just installed SliTaz to your HDD? Really, some folders in the root FS wants to be read/write (/tmp, /var, and of course /home) to save your preferences.

I think, you can use tmpfs for this folders to place them in RAM instead of HDD. And, additionally you need to re-create your home folder at every boot (like LiveCD do it).

Sorry, but I can't help you more, I have no experience in this sort of instals.

Personally, I prefer "frugal" install - this is like LiveUSB but I have my kernel and rootfs in the HDD folder. Yes, all loads into RAM, but why you don't like this?

If you'll run several applications then they all will loads into RAM. But we have them already in RAM. If you'll remove all apps what you don't need and install additional packages what you need then you'll get fast reliable system. You can kill your system and it revive after every reboot at the original (your!) state.

Offline

#3 2012-09-21 17:58:10

xjjx
Member
Registered: 2012-09-21
Posts: 17

Re: HDD Install read-only

Hi Aleksej,

I try to minimalize RAM usage because I need this to load instruments/samples etc. So, I thought Slitaz loram is the way to go .. but it fail when I try make isohybrid and put it on USB (because of no optical device). I don't bother about system boot time, because it will be installed not on CD/DVD but rather than on pendrive. OFC HDD install is good , but I'm afraid about fs coruption on e.g. power supply fail. So, almost entire OS can be "freeze", some directories can be recreated. I will "unfreeze" it only when I need to upgrade something or change configuration etc.

In this mentioned article there is section about problems with startup scripts. I wonder how this looks on slitaz ? If I made HDD install and then mount / as ro (and recreate /var /home, tmpfs on /tmp) - what happen , it crash or not ?

In other words - I need a minimal list of directories/files where slitaz need write access to boot ? OFC I can check this experimentally - but maybe someone already think about it.

Offline

#4 2012-09-21 19:20:27

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: HDD Install read-only

I cope with that article (about 4 hours ago). It is some sort of quest wink And I like quests so much. But, sadly I already have 4 primary partitions on my netbook's HDD... I have no free separate partition to install SliTaz, and don't want to delete... But... I can do it on one of my USB sticks! Traditional installation...

I have no answers, but interesting to get them.

Offline

#5 2012-10-09 08:43:36

xjjx
Member
Registered: 2012-09-21
Posts: 17

Re: HDD Install read-only

Hi,

Meantime I read about "loop install"

http://doc.slitaz.org/en:guides:uncommoninst

Is this copy all stuff to RAM while boot or not ?

Offline

#6 2012-10-09 12:19:47

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: HDD Install read-only

Frugal install load all system to memory, however i think you can reduce the used ram with the lowram switch.

I also thing it is possible to maintain /usr on disk while loading the rest of the system but again i speak only on memory from what i read here so i could be wrong.

Do some research on the forum and google, wih slitaz frugal install

Offline

#7 2012-10-09 14:15:37

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: HDD Install read-only

Is this copy all stuff to RAM while boot or not ?

No, according to the doc a standard install which doesn't copy the entire filetree to RAM is the only type of install that works with a loop file .

Reference: http://doc.slitaz.org/en:guides:uncommoninst

Loop install

If you want to install SliTaz on a disk (not a frugal install), and you don't want to create a partition for SliTaz, but you have enough room in a feature-poor filesystem (FAT32 or NTFS)…

Offline

#8 2012-10-09 14:49:50

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: HDD Install read-only

by the way i went to your link. Not sure what prevents you to try what they are saying, it seems pretty easy to do, really.

In one of the startup files, /etc/init.d/rcS, is where the remount / rw happen, I believe. This is probably where modification should take place.

I would do the test from your existing slitaz installation, booted, just remount / ro and see what happens, after you have made your homework for /tmp and /var as they say. Worst thing, you may need to reboot. I would probably manage to make /root writeble just in case, not sure otherwise what happens when you try to su.

Anyway this seems like a pretty low risk checking to try as you do not need to make any modification to your system at first. Just issue all commands manually and see what happens. If it works then do all required changes to the system files.

Offline

#9 2012-10-17 15:15:30

xjjx
Member
Registered: 2012-09-21
Posts: 17

Re: HDD Install read-only

Hi,

I try read-only soon, cause now discover loopfs option. Can I hijack my own thread ? I hope you forgive me ;-)

Well, I just trying loopfs install but from ext4 partition. I preapred slitaz.fs file with documentation. Then I create preinit image and install grub, and create menu.lst file. And I even restore bzImage and rootfs.gz from preinit iso.

Below I copy my menu.lst. If I choose first option then it load kernel, and hang after display:

--

Trying to unpack rootfs image as initramfs ...

Switched to NOHz mode on CPU #0

--

Second option from boot menu display:

--

Error 17: Cannot mount selected partition

--

I try use also /dev/hda1). After all I must add that I use VirtualBox. Option first seems to be pretty close to goal, cuase seems that it load kernel, and unpack initrd sucessfully - but it probably does not mount loopfs file (hmm ... init? - can enable some verbose mode ?). Any hints ?

--

title Slitaz loop

root (hd0,0)

kernel /boot/bzImage mount=/dev/sda1 loopfs=slitaz.fs

initrd /boot/rootfs.gz

title Slitaz loop2

map --mem --heads=0 --sectors-per-track=0 (hd0,0)/boot/slitaz-preinit.iso (hd1)

map --hook

kernel (hd1)/boot/bzImage mount=/dev/sda1 loopfs=slitaz.fs

initrd (hd1)/boot/rootfs.gz

Offline

#10 2012-10-17 16:24:52

mojo
Administrator
Registered: 2011-03-29
Posts: 2,174

Re: HDD Install read-only

Well, I just trying loopfs install but from ext4 partition.

Maybe your using the wrong filesystem and bootloader?

http://doc.slitaz.org/en:guides:uncommoninst

The following configurations are using the SliTaz 4.0 boot loader grub4dos-linux.

Loop install

If you want to install SliTaz on a disk (not a frugal install), and you don't want to create a partition for SliTaz, but you have enough room in a feature-poor filesystem (FAT32 or NTFS)…

Offline

#11 2012-10-17 17:14:56

xjjx
Member
Registered: 2012-09-21
Posts: 17

Re: HDD Install read-only

Guys - it's alive ! My previous preinit.iso was broken. I figured out that rootfs.gz have only 13 bytes. Unfortunately pure slitaz 4.0 always create me broken images - but I have also second Vbox with installed wok and all devel-build packages where I generate good preinit. Whatever .. option 1 is even better because it does not require preinit.iso but only bzImage/rootfs.gz files.

@mojo - I know that, but my test prove that it can be done via ext fs and regular grub ;-)

Offline

#12 2012-10-17 20:09:26

xjjx
Member
Registered: 2012-09-21
Posts: 17

Re: HDD Install read-only

it's not working sad It only boot to initrd image. I see it mount /dev/sda1 to /mnt and slitaz.fs (as /dev/loop0) to /mnt. Probably then it run switch_root .. but something went wrong.

I created some additional files in slitaz.fs and on /dev/sda1 - but after boot I can't find them - that's why suppose it is still rootfs.gz.

BTW. it is generally good idea to mount twice something to the same directory ? I check /init script and seems that's what it did.

Offline

#13 2012-10-18 15:48:39

xjjx
Member
Registered: 2012-09-21
Posts: 17

Re: HDD Install read-only

I found bug ;-)

/init script mount tmpfs on top of / and then exec swtich_root (launch_init function).

I comment out lines 173 - 193 (from "Switching / to tmpfs). According to this graph:

http://doc.slitaz.org/en:guides:bootguide

it shouldn't mount tmpfs on /. So, there should be an exception. My simple patch (workaround):

$ diff init init.xj

170a171

> if ! grep -q loopfs= /proc/cmdline; then

193a195

> fi

Can you add this fix (or some better for this issue) in 4.0 ?

Offline

#14 2012-10-18 16:23:40

bellard
Administrator
Registered: 2011-03-28
Posts: 657

Re: HDD Install read-only

Pushed, thanks.

http://hg.slitaz.org/wok-stable/rev/176e5cd6fb16

http://hg.slitaz.org/slitaz-boot-scripts/rev/f637482683e2

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.020 seconds, 7 queries executed - Memory usage: 1.56 MiB (Peak: 1.77 MiB) ]