PDA

View Full Version : Read Only HD install



iw2lsi
04-14-2004, 08:19 PM
Hi... is it possible to have knoppix installed on a HD partition in ReadOnly mode ?
I need a very stable system, with the ability to quickly install new sw, reconfigure the network and so on... I was thinking on a RO partition with the ability to mount it as RW in the boot phase (grub prompt for example)... is it possible ?

thanks in advance for any comments.


Giampaolo

OErjan
04-15-2004, 07:19 PM
you could remount it rw from the comandline (as root) of a konsole, xterm...

mount -o remount,rw /dev/hda1 /mnt/hda1
will do that just fine.

the problem is that you will have some files requiring written to in /home/user.
a diferent way is to make a copy of that users hoedir and wipe it at each logout and cp -a everything back right away. there should be a way to do that as part of the comand logout i guess.
should be possible to alias logout to do

rm -rf /home/username/*&&cp -a /blankhome/* /home/username&&sync&&clear&&logout
if that alias is in each users .bash.rc and a new basic ~/ is made for each user... should not be more than some 5-10Mb or so for each user. or perhaps same for all of them?

iw2lsi
04-15-2004, 11:12 PM
Hi OErjan.

thanks a lot for your help. I've try to remount my root partition with the command you suggested but I've got this:

[root@ir2ip /]# mount -t ext3 -o remount,ro /dev/hda2 /
mount: / is busy

looking at the docs, it seems that you can have an EBUSY error if there is a file oper for write... so, how can one close all opened file ?

Also, I was no able to boot my HD knoppix distro as RO... maybe I miss something, but really I don't understand if the knoppix HD installation script build an HD RW distro or an HD RO distro.

users dirs are not problems at this time, as I can redirect them (or part of them) to a RW partition.

thanks again,

Giampaolo

mzilikazi
04-16-2004, 12:43 AM
Hi... is it possible to have knoppix installed on a HD partition in ReadOnly mode ?
I need a very stable system, with the ability to quickly install new sw, reconfigure the network and so on... I was thinking on a RO partition with the ability to mount it as RW in the boot phase (grub prompt for example)... is it possible ?

thanks in advance for any comments.


Giampaolo

This makes no sense to me. A stable system w/ the ability to install sw would need a RW filesystem. Maybe I don't understand what you're trying to accomplish.

iw2lsi
04-16-2004, 08:25 AM
Hi mzilikazi..

think at what I call a "RO HD Knoppix" as a normal Knoppix distro ported from CD to HD... you can boot and work faster, as HD speed is greater than CD speed... you can reconfigure your system (for example the network settings) but when you reboot (if no persistent dir are used), you miss all changes and the system start with standard settings.
This is the distro I need for my "standard" end-users. It's very stable and fast.

Now think that one of your customer want to upgrade, for example, the Gimp package... you can simply reboot the system, stop normal grub boot with a password and launch the same kernel but with the HD partition in RW mode.
Maybe it's also possible to remount the HD partition in RW mode on the fly, as suggested in this thread.
You can than reconfigure & upgrade the system and this setting will be persistent. This is what I call "RW HD Knoppix".


Maybe this is not the right idea to obtain what I need.... so if you have another solution please let me know.

thanks,
Giampaolo

mzilikazi
04-17-2004, 05:47 PM
Now I think I understand. This is actually how I get set up to do a remaster and I think it will work for your situation. I am writing some docs for it but they are not yet finished. Here is a brief summary:

Boot Knoppix.
cd /KNOPPIX
cp -a * /mnt/hda5 (at least 2.1G)

Copy the /etc/fstab from cd to hdd too or it won't work!

You should see the complete / filesystem on your hdd like so:

bin cdrom etc home lib mnt proc sbin tmp var
boot dev floppy initrd lost+found opt root sys usr vmlinuz

cd /mnt/hda5/home
mkdir -p knoppix
chown 1000.1000 -R knoppix

Edit your grub/menu.lst:

title Linux
kernel (hd0,4)/boot/vmlinuz ro root=/dev/hda5 hdb=scsi apm=power-off nomce vga=791 lang=us

This way you have a bootable Knoppix file system that boots from hdd. You also get the autodetection- just as if it were the cd.

Now if you want to install software simply edit the boot line and change 'ro' to 'rw'. After booting you can add and remove software as normal. It just now dawns on me the you could just have a second boot line that is already set to rw if you wanted to use lilo. Obviously if your users can boot the system they can boot it rw too and then they can install software too. :( You would need to secure the system in some way.

There is more involved if you want to add a user but you can probably figure it out no problem. Also you would need to move /home to another partition and mount it rw if the users are to be able to save their configurations and such. I have not thought a great deal about that aspect of it but I don't see why it would not work. Just add it to /etc/fstab.

Hopefully I finish with the docs soon :)

HTH

iw2lsi
04-18-2004, 02:56 PM
Hi mzilikazi

thanks a lot for your info... I'll try your way as soon as possible...


Giampaolo