On Wed, Jan 18, 2006 at 05:56:31PM -0500, Ken Heard wrote: > Almut Behrens wrote: > > >Copy /etc/fstab to /tmp/fstab and fix your "drfaults" typo in there. > > I copied /etc/fstab to /var/fstab and fixed the typ. > > >Then patch a temporary copy of /bin/mount and libc.so to use /tmp/fstab > >instead of /etc/fstab. To do so, create this little script, make it > >executable, and run it as root: > > Because I used /var instead of /tmp I modified your script as > follows: > > >#!/bin/bash #You suggested /bin/sh > > > >FSTAB=/var/fstab # var changed from tmp > >LIBC=/lib/libc.so.6 > > > >perl -pe "s|/etc/fstab|$FSTAB|g" $LIBC >/var/libc.so.6 # var changed > >from tmp > >perl -pe "s|/etc/fstab|$FSTAB|g" /bin/mount >/var/mount # ditto > >chmod +x /var/mount # ditto > >export LD_PRELOAD=/var/libc.so.6 # ditto > >/var/mount -n -o remount,rw /
The modifications look okay. (Just make sure there's nothing after the "#!/bin/bash" in the first line -- though I presume you've appended that comment just in this post here... BTW, just FYI, /bin/sh and /bin/bash should both work, as (on linux) /bin/sh is just a link to /bin/bash, i.e. they're the same program. The only difference is that if bash is called as "sh" it mimics the behavior of a regular bourne shell. This shouldn't matter here, though, as there's nothing bash-specific in the script...) > > I saved this script as /var/fixfstab, made it executable and -- as > root and in /var -- ran ./fixfstab. The following was returned: > > : bad interpreter: No such file or directory Typically, you'd get this error, if you create the file on Windows and then copy it over to linux. The problem is the different line ending conventions (\n on Linux, and \r\n on Windows), which is not always immediately evident -- unless you already know what to look for. Due to this, there'd be a trailing \r at the end of the interpreter name, i.e. the system is trying to find a program "/bin/bash\r", which of course doesn't exist... To check, you could do a "less -u /var/fixfstab"; if you have the above problem, you'd see ^M (= \r = carriage return) at the end of the lines. To fix it, run the following command perl -i -pe 's/\r//g' /var/fixfstab and then try again... (and, if it still doesn't work, report back here). Almut -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]