Results 1 to 4 of 4

Thread: Install as RO filesystem

  1. #1
    Junior Member
    Join Date
    Mar 2005
    Posts
    3

    Install as RO filesystem

    Hi all,

    I have an app that I want to run on linux that does not require filesystem access. I want to install it on several computers which may be turned on and shut down ungracefully, so I want to be sure that nothing is ever written to disk anyway. I thought knoppix would be a good place to start, because being CD-ROM based, it runs happily on a read-only filesystem.

    I installed knoppix on a computer using knoppix-install from the CD, using the "CD-based" distribution option. I set the / filesystem to ro via /etc/fstab, but it is still mounted as rw and I can still write to the filesystem when the computer boots up. I want to enforce that the / partition remain ro so that I know nothing is writing to it, and the computer can bounce any time without any files open.

    Does knoppix mount the filesystems from some location other than /etc/fstab?

    Al

  2. #2
    Senior Member registered user
    Join Date
    Feb 2005
    Location
    Colorado, USA
    Posts
    205
    Does knoppix mount the filesystems from some location other than /etc/fstab?
    Well, yes and no.

    Knoppix actually rewrites /etc/fstab while the computer is booting. You can see when this happens - a line is written to the screen in blue and yellow that says,
    Code:
    Scanning for Harddisk partitions and creating /etc/fstab...
    If it goes by too fast, you can review the boot process by typing
    Code:
    $ dmesg
    This behavior is a good thing when running from CD, because the disk never knows from one boot to the next what environment it will find. It's probably not that useful after installation to HD, and can be downright annoying in situations like yours.

    True to the Unix Way, there are different options for dealing with this default behavior. The easiest is probably to give the Knoppix parameter nofstab at boot time. You can do it each and every time you want to skip the rewrite or, if you're using a bootloader, add a line like this:
    Code:
    append="nofstab"
    If there's already an append line, just add to it:
    Code:
    append="lang=us nofstab"
    Note that this isn't a kernel parameter - it's specific to Knoppix. So it won't work if you do a Debian install. Of course, it won't be needed if you do a Debian install.

    Other ways involve modifying the script that carries out the procedure, and aren't hard at all. Do this by editing (as root) /etc/init.d/knoppix-autoconfig. On my system there are 12 lines of code starting at line 951 (or search for nofstab). The file has useful comments inside, so it's easy to see what it does.

    You can comment these lines out by adding # at the beginning of each one. (Well, two of the lines are already just comments, so you'd do that to the other 10.) Or you could add a test for HD-install - the script already does that for other actions, so you could browse through the file and see how it's done elsewhere.

    Still other ways might be to have the boot process skip this whole script entirely, or put something else in its place. Whatever gets you down the road.

    I hope this helps!

    -- Ed

  3. #3
    Junior Member
    Join Date
    Mar 2005
    Posts
    3
    Hi mr_ed

    Thank you for the reply! I was able to set my fstab the way I liked it, and now I understand better how knoppix boots. But I found in the same file, on line 486:

    Code:
    # / must be rw in any case, starting from here
    mount -o remount,rw / 2>/dev/null
    so it remounts root as rw anyway. Back to square #1, I booted again from CD, and found that it creates a 2mb root partition on "/dev/root", then fills it with a default filesystem full of symlinks to the CD. It's great! All the binaries are run from the CD image, but / is still a writable partition for temporary files.

    Now I'm stuck though. Where does it get /dev/root from? And what populates it with the filesystem full of symlinks? I suspect the answer lies in a pivitroot call, but I don't know much about pivitroot, or where it's called from. I didn't find any hints in the knoppix-autoconf script.

    Basically, I want to be able to do this same thing when booting from the hard drive: mount the hard drive as read-only, then create a root mountpoint that contains this same default filesystem as when booting from the CD. Then I would have a temporary root filesystem that could be trashed and thrown away, and start over when the box is rebooted.

    Are there any hints for where I should look to accomplish this?

    Thanks all!

    Al

  4. #4
    Senior Member registered user
    Join Date
    Feb 2005
    Location
    Colorado, USA
    Posts
    205
    As you saw, I was in over my head with the last question, never mind this one!

    I'm sorry, I don't know. I did some poking around but didn't find anything useful. I would suspect that it was something on the CD (in the compressed KNOPPIX file) that didn't get copied to HD, but when you remaster a new CD, everything comes from the HD.

    This should be an easy question for someone who knows the process better. If you don't get an answer shortly, give another shout.

    -- Ed

Similar Threads

  1. Compressed filesystem
    By abby in forum Customising & Remastering
    Replies: 0
    Last Post: 03-11-2007, 09:56 AM
  2. how to install. new to filesystem
    By pyromaniac in forum MS Windows & New to Linux
    Replies: 2
    Last Post: 12-02-2006, 08:26 PM
  3. Trying to Resize Windows Filesystem for Knoppix/DEB Install
    By rossi in forum MS Windows & New to Linux
    Replies: 3
    Last Post: 07-06-2005, 09:24 PM
  4. Install over previous ReiserFS filesystem stalls.
    By mallyone in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 02-01-2005, 10:46 PM
  5. compressed filesystem?
    By rex in forum Hdd Install / Debian / Apt
    Replies: 0
    Last Post: 05-25-2004, 04:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Cisco Meraki MS120-48LP 48 Port Blade Ethernet Switch UNCLAIMED picture

Cisco Meraki MS120-48LP 48 Port Blade Ethernet Switch UNCLAIMED

$799.00



NEW Cisco Meraki MR44 802.11ax Wi-fi 6 Wireless Access Point MR44-HW UNCLAIMED picture

NEW Cisco Meraki MR44 802.11ax Wi-fi 6 Wireless Access Point MR44-HW UNCLAIMED

$399.98



Cisco RV160 VPN Router 4 Gigabit Ethernet Ports RV160-K9-AR picture

Cisco RV160 VPN Router 4 Gigabit Ethernet Ports RV160-K9-AR

$80.00



Cisco IP Phone 6841 – CP-6841-3PW-NA-K9= picture

Cisco IP Phone 6841 – CP-6841-3PW-NA-K9=

$75.00



Cisco WS-C3850-48P-L 48-Port Gigabit 3850 PoE Switch w/ 715W+ C3850-NM-4-1G Mod picture

Cisco WS-C3850-48P-L 48-Port Gigabit 3850 PoE Switch w/ 715W+ C3850-NM-4-1G Mod

$83.00



Cisco QSFP-40G-SR-BD BiDi Short-reach Transceiver, 1 Year Warranty picture

Cisco QSFP-40G-SR-BD BiDi Short-reach Transceiver, 1 Year Warranty

$17.25



Cisco C3850-NM-2-10G 2 Port Network Exp.Module for 3850 picture

Cisco C3850-NM-2-10G 2 Port Network Exp.Module for 3850

$44.99



Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03  picture

Genuine Cisco SFP-10G-SR V03 10GBASE-SR SFP+ Transceiver Module 10-2415-03

$8.00



Cisco WS-C3850-48F-S Catalyst 3850 48x 1GB PoE+ RJ-45 1x Module Switch picture

Cisco WS-C3850-48F-S Catalyst 3850 48x 1GB PoE+ RJ-45 1x Module Switch

$185.00



Cisco Catalyst 3850 WS-C3850-48U-S 48-Port UPOE Gb Switch w/ NM-2-10G (BH) picture

Cisco Catalyst 3850 WS-C3850-48U-S 48-Port UPOE Gb Switch w/ NM-2-10G (BH)

$134.96