PDA

View Full Version : Changing to read/write mode mounting Knoppix



kermitq
09-02-2006, 06:19 PM
Hi all,

I use USB Flash Drive for Knoppix ,but it is mounted as read only media So the question is: how to set Knoppix's USB mounting from read-only to read-write. What script does mount Knoppix's media ?

Cheers!

Harry Kuhman
09-02-2006, 06:23 PM
Answer #6 (http://www.knoppix.net/wiki/User:Harry_Kuhman).

ockham23
09-02-2006, 06:25 PM
Right click on the desktop icon of the drive and select "mount". Right click on the desktop icon again and select "Actions --> Make drive writable".

kermitq
09-02-2006, 10:35 PM
no, the problem is not so silly as You thought.

Harry, I You cant unmount partition that is used by the filesystem at the same time(in my case it is a usb stick wtih knoppix).

ockham23, yes i agree , but the usb is my knoppix media.

The question was: how to change the default read-only mode mounting to read write, not by simply unmouting and mounting in other mode, but changing the script which mounts drive on system init. Where could i find mentioned script ?

P.

Harry Kuhman
09-02-2006, 11:16 PM
no, the problem is not so silly as You thought.

Harry, I You cant unmount partition that is used by the filesystem at the same time(in my case it is a usb stick wtih knoppix).

You didn't make it clear that you actually had knoppix on the USB device with the previous post. You said


I use USB Flash Drive for Knoppix
That not quite the same as saying that you boot Knoppix from the USB device, it just implies that you have a USB stick that you want to use for Knoppix, perhaps to save data or programs.

I think you may have to partition the device as two partitions, on for the system and one for data.

kermitq
09-03-2006, 07:58 AM
Yes, I've just made two partitions.

But, I still return to my previous question. Is it possible set Knoppix for mounting its media to read/write mode ?

maxIT
09-03-2006, 09:55 AM
no, the problem is not so silly as You thought...


Maybe I understand what you mean.
I've experienced this isssue with 'exhotic' devices. With 'exhotic' I mean not simply usb_key but such devices as PSP(sony). Knoppix installs (not live_cd, not tried) completly fails to mount it. I can mount such devices only with a kanotix install, but they will be recognized as 'read_only_file_ system', and after an 'ls -l /media/sda1' check I have a result like:


-rx-r------- guest guest .....

And even after become root and giving a 'chmod 777 /media/sda1' command the shell again says 'read-only file system!'. :?
This not always happen and once I was able to mount a PSP on knoppix/kanotix_install with r/w rights.
To avoid the only_read_fs_issue maybe is necessary crete a filesystem from scratch [mkfs.vfat...], but not tried, being PSPs of costumers and not mine.

kermitq
09-03-2006, 01:55 PM
so the media on which knoppix is burned/copied ( cd, or usb ) cant be mouted as read-write even after changing some its internal scripts ?

maxIT
09-03-2006, 04:50 PM
Last chanche (maybe), check '/etc/fstab' root mountpoint that being without read_only flag.
This is the file you call 'script' (actually it isn't a script, but a 'config file').
The below is mine, you can notice the 'ro' only in case of faulting-reboot, not default.


/dev/hda2 / ext3 defaults,errors=remount-ro 0 1

kermitq
09-03-2006, 07:58 PM
yes i know what config file is :)

But knoppix adds autmaticaly lines to fstab. The Knoppix CD is add to fstab dynamically. and it is added as read-only (nothing strange if it is CD - but I use Knoppix on USB pendrive). I'm looking for scripts which adds these lines to fstab config file. Maybe in that script I could change mounting to read-write.

P.

maxIT
09-03-2006, 09:35 PM
But knoppix adds autmaticaly lines to fstab. The Knoppix CD is add to fstab dynamically. and it is added as read-only (nothing strange if it is CD - but I use Knoppix on USB pendrive). I'm looking for scripts which adds these lines to fstab config file. Maybe in that script I could change mounting to read-write.


Ah ok, in this case the 'script file' :P is '/etc/init.d/knoppix-autoconfig'.
You have to look for a bunch of lines that starts with something like '# Starting creating /etc/fstab...' and comment_out/delete them or follow a less_invasive way already suggested by me here. (http://www.knoppix.net/forum/viewtopic.php?t=25365&highlight=) :wink:

kermitq
09-04-2006, 05:26 AM
And that it is what I what to know! I will try to mod auto-config when I return home after my job.

Cheers

tablet_guy
09-04-2006, 08:49 AM
Hi all,

I use USB Flash Drive for Knoppix ,but it is mounted as read only media So the question is: how to set Knoppix's USB mounting from read-only to read-write. What script does mount Knoppix's media ?

Cheers!

You may want to try mount -o remount,rw {device_name} {mount_point}

Here, {device_name} is the device name for your usb partition as it is booted into (may be /dev/sda1 ?), and {mount_point} is most likely "/cdrom", but I am not 100% sure.

If things don't work out, please post the listings from "mount" command and "cat /proc/mounts" when booted in.

Also, please describe how you get it to boot. Are you following the instructions here? (http://www.knoppix.net/wiki/USB_Based_FAQ)

Please note that I am not a "guru", but know a couple of things here and there.

tablet_guy
09-04-2006, 08:51 AM
If you want to modify the system file itself so that it always boots RW, I think that the file to look at is "linuxrc" which is found inside the miniroot.

firnsy
09-04-2006, 11:27 PM
If you want to modify the system file itself so that it always boots RW, I think that the file to look at is "linuxrc" which is found inside the miniroot.

This is correct you are looking for approximately line 487 in linuxrc. If you change from this

mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX=""
to this

mountit /dev/cloop /KNOPPIX "-o rw" || FOUND_KNOPPIX=""
you should be on the right track.

tablet_guy
09-05-2006, 03:19 AM
If you want to modify the system file itself so that it always boots RW, I think that the file to look at is "linuxrc" which is found inside the miniroot.

This is correct you are looking for approximately line 487 in linuxrc. If you change from this

mountit /dev/cloop /KNOPPIX "-o ro" || FOUND_KNOPPIX=""
to this

mountit /dev/cloop /KNOPPIX "-o rw" || FOUND_KNOPPIX=""
you should be on the right track.

Actually, I doubt if that'd work. A cloop device is not writable, as of now. The device holding the KNOPPIX root file system image needs to be set "rw".

The problem is that, it isn't clear exactly how the poster is booting into the USB stick, and what filesystem is on the partition where KNOPPIX root fs is located by the booting process (namely initrd). He/she could also be using Rumbyeke's setup, for all you know.

Let me assume that his setup is as follows: the USB partition is formatted as some fs other than NTFS, and all the files found on knoppix CD (not just the compress root fs) are found in that partition's root folder.

Then, I think that the line to modify is line 467, from


if mountit $i /cdrom "-o ro" >/dev/null 2>&1; then

to


if mountit $i /cdrom "-o rw" >/dev/null 2>&1; then


Strictly speaking, the script should be modified to adaptively or upon a boot prompt option permit mounting the boot media RW, because, this line would fail for non-RW devices like the cdrom.

If the posted is still following, let him/her try and make this change and see if it works.

I will post a followup regarsless, as soon as I am able to do some testing on my own with the latest version of Knoppix (I had played with this on earlier versions).

thanks.

firnsy
09-05-2006, 04:20 AM
:D yes ... my bad, to be honest I didn't even look closely at the line, still waking up.


Strictly speaking, the script should be modified to adaptively or upon a boot prompt option permit mounting the boot media RW
This would be the elegent solution


because, this line would fail for non-RW devices like the cdrom.
It shouldn't fail, mount is smart enough to recognise that the medium is in fact read only and act accordingly by notifying on stderr that it is mounting read only and even returning an successful code 0.

kermitq
09-08-2006, 07:57 AM
the results of linuxrc's customizations:

after changing one line to:


if mountit $i /cdrom "-o rw" >/dev/null 2>&1; then

The system boots, but the usb stick is still read-only.

After changing two lines lines, (following both tablet_guy and firnsy's posts)


mountit /dev/cloop /KNOPPIX "-o rw" || FOUND_KNOPPIX=""
...

if mountit $i /cdrom "-o rw" >/dev/null 2>&1; then

system doesn't boot. Linux boots with error : 'Cant find KNOPPIX filesystem'

Cheers.

firnsy
09-08-2006, 10:45 PM
As tablet_guy mentioned, don't do my change as it isn't correct, I was supposed to post the line that tablet_guy mentioned.

For the reasons you have found out, the following will NOT work


mountit /dev/cloop /KNOPPIX "-o rw" || FOUND_KNOPPIX=""

What, if any, boot codes are you using in addition to the defaults?

kermitq
09-09-2006, 06:26 AM
I just start with 'knoppix'

But I also started only with changes presented by tablet_guy



if mountit $i /cdrom "-o rw" >/dev/null 2>&1; then


It started but, dev/sda1 (the knoppix disk) was still read only.