http://www.linux-vserver.org/index.php?title=Read-only_RootFS&feed=atom&action=historyRead-only RootFS - Revision history2024-03-28T10:12:36ZRevision history for this page on the wikiMediaWiki 1.20.2http://www.linux-vserver.org/index.php?title=Read-only_RootFS&diff=4886&oldid=prevGlenn: +cat2011-10-21T19:21:16Z<p>+cat</p>
<table class='diff diff-contentalign-left'>
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:21, 21 October 2011</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 40:</td>
<td colspan="2" class="diff-lineno">Line 40:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Note that the vserver has to be started read-writeable once. Now that it has been started and stopped, change the 'rw' to 'ro' in fstab.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* Note that the vserver has to be started read-writeable once. Now that it has been started and stopped, change the 'rw' to 'ro' in fstab.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[Category:Documentation]]</ins></div></td></tr>
</table>Glennhttp://www.linux-vserver.org/index.php?title=Read-only_RootFS&diff=4664&oldid=prevDude: Created page with '=Read-only RootFS= ==Preparing== * Build your host vserver vs1 build --force -m debootstrap --hostname vs1.localhost -- -d squeeze -m http://ftp.se.debian.org/debian ==Modif…'2011-05-23T10:32:03Z<p>Created page with '=Read-only RootFS= ==Preparing== * Build your host vserver vs1 build --force -m debootstrap --hostname vs1.localhost -- -d squeeze -m http://ftp.se.debian.org/debian ==Modif…'</p>
<p><b>New page</b></p><div>=Read-only RootFS=<br />
<br />
==Preparing==<br />
<br />
* Build your host<br />
vserver vs1 build --force -m debootstrap --hostname vs1.localhost -- -d squeeze -m http://ftp.se.debian.org/debian<br />
<br />
==Modifying==<br />
<br />
* Modify /etc/vservers/vs1/fstab according to<br />
<br />
/etc/vservers/vs1/vdir / ext3 bind,rw,dev 0 0<br />
none /proc proc defaults 0 0<br />
none /tmp tmpfs size=16m,mode=1777 0 0<br />
none /var/lock tmpfs size=16m,mode=1777 0 0<br />
none /var/run tmpfs size=16m,mode=1777 0 0<br />
none /lib/init/rw tmpfs size=16m,mode=1777 0 0<br />
none /dev/pts devpts gid=5,mode=620 0 0<br />
/writeable_root/vs1 /home/vs1 ext3 bind,dev 0 0<br />
<br />
* Add an .oldroot-directory to the installation (vcontext creates this directory, but skips if it already exists)<br />
mkdir /etc/vservers/vs1/vdir/.oldroot<br />
chmod 0700 /etc/vservers/vs1/vdir/.oldroot<br />
<br />
* Create the folder that holds the log-folder ( If you want to save these. )<br />
mkdir -p /writeable_root/vs1/log<br />
mkdir /etc/vservers/vs1/vdir/home/vs1<br />
rm -rf /etc/vservers/vs1/vdir/var/log<br />
ln -s ../home/vs1 /etc/vservers/vs1/vdir/var/log<br />
<br />
==Completing==<br />
<br />
* Start the vserver and stop it, to make use of the .oldroot.<br />
vserver vs1 start<br />
vserver vs1 stop<br />
<br />
* If the root is still read-write inside the vserver, add the following to pre-start script<br />
mkdir /etc/vservers/vs1/scripts<br />
echo "mount -o bind,remount,ro . ." > /etc/vservers/vs1/scripts/pre-start<br />
<br />
* Note that the vserver has to be started read-writeable once. Now that it has been started and stopped, change the 'rw' to 'ro' in fstab.</div>Dude