Page 1 of 1

HDD NTFS partition is mounted rw

Posted: 01 May 2013, 16:00
by golimar
I have the Porteus ISO file on my Win7 NTFS partition, and use the from= cheatcode to use that ISO. I see now that the NTFS partition is mounted read-write, is this necessary? Where can I change this?

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 17:55
by Hamza
I think you can use fstab for this

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 18:09
by golimar
Would that mean rebuilding the original Porteus ISO image with a modified fstab?

By the way, I also tried to remount it as read only, but it's not allowed: "Remounting is not supported at present. You have to umount volume and then mount it once again"

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 18:11
by Hamza
Which partition would you like to mount in RO only?

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 18:32
by golimar
This one:
/dev/sda1 on /mnt/sda1 type ntfs (noatime,nodiratime,suid,dev,exec,async)
That's where the Porteus ISO is stored.

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 18:55
by Hamza
How are you booting Porteus ?

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 19:00
by Ahau
you could us the 'nohd' cheatcode to avoid mounting the hard drive at all inside the live filesystem, or you could use the 'mopt=' cheatcode to change the default mount options to include 'ro', e.g.

Code: Select all

mopt=noatime,nodiratime,suid,dev,exec,async,ro
I'm not sure how how a custom fstab will be handled since it's usually created on the fly, but if you want to try one, you can put it in an external rootcopy folder with the 'rootcopy=' cheatcode.

More on the cheatcodes here:
http://www.porteus.org/tutoriels/57-gen ... cheatcodes

Re: HDD NTFS partition is mounted rw

Posted: 01 May 2013, 22:32
by fanthom
was also going to suggest 'mopt=' cheatcode but found that it does not work for ntfs-3g as busybox is not able to pass mount flags included in fstab to ntfs-3g.
will post updated initrd in this thread once the issue is fixed.

EDIT:\\
here is updated initrd for 64bit porteus-2.0:
link
and here is for 32bit:
link
also: in /etc/fstab ntfs partitions will be correctly shown as handled by 'ntfs-3g' driver and not 'ntfs'.

please create new ISO (with new initrd) and use 'mopt=ro' to mount ntfs (along with other filesystems) as read-only.

Re: HDD NTFS partition is mounted rw

Posted: 10 May 2013, 13:00
by golimar
I tried 'mopt=ro' and now the 'mount' command shows 'ro' for that partition, however I can write and create files in that partition. I guess that's what fanthom was meaning.
I also tried 'nohd' but in this case it fails to boot (I am using the from= cheatcode so I guess that this prevents it to find the ISO file that I'm pointing at with from=)

Re: HDD NTFS partition is mounted rw

Posted: 10 May 2013, 21:04
by fanthom
I tried 'mopt=ro' and now the 'mount' command shows 'ro' for that partition, however I can write and create files in that partition.
works ok here (can't write to ntfs partition) so you must be still booting with old initrd. please boot porteus, upload /mnt/live/linuxrc to pastebin.com and link here. i'll tell you then if this is updated initrd or the old one.
I also tried 'nohd' but in this case it fails to boot (I am using the from= cheatcode so I guess that this prevents it to find the ISO file that I'm pointing at with from=)
never tried booting from ISO with 'nohd', my memory tells me that it should work ok but will double check this evening.

EDIT:\\
booting from ISO works with 'nohd' cheatcode but you must provide full path to the ISO. example: from=/mnt/sda4/porteus.iso.

in your case you can either mount ntfs as read-only with updated initrd and 'mopt=ro' cheatcode (guest will still be able to read from the partitions) or better - boot with following set of cheatcodes:

Code: Select all

from=/full_path_to/porteus.iso nohd copy2ram
this way access to hd is completely disabled for guest (but still can mount removable media like usb stick/cd).

Re: HDD NTFS partition is mounted rw [SOLVED]

Posted: 16 May 2013, 13:59
by golimar
Your last option worked like a charm, even with the old initrd.
I use now in my PC: from=/mnt/sda1/porteus.iso nohd copy2ram
Thanks!