HDD NTFS partition is mounted rw

Here you can post about non-standard installation methods
(for example when using grub4dos).
Post Reply
golimar
White ninja
White ninja
Posts: 8
Joined: 25 Apr 2013, 10:01
Distribution: Win7, Debian, Knoppix, Porteus
Location: Spain

HDD NTFS partition is mounted rw

Post#1 by golimar » 01 May 2013, 16:00

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?

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: HDD NTFS partition is mounted rw

Post#2 by Hamza » 01 May 2013, 17:55

I think you can use fstab for this
NjVFQzY2Rg==

golimar
White ninja
White ninja
Posts: 8
Joined: 25 Apr 2013, 10:01
Distribution: Win7, Debian, Knoppix, Porteus
Location: Spain

Re: HDD NTFS partition is mounted rw

Post#3 by golimar » 01 May 2013, 18:09

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"

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: HDD NTFS partition is mounted rw

Post#4 by Hamza » 01 May 2013, 18:11

Which partition would you like to mount in RO only?
NjVFQzY2Rg==

golimar
White ninja
White ninja
Posts: 8
Joined: 25 Apr 2013, 10:01
Distribution: Win7, Debian, Knoppix, Porteus
Location: Spain

Re: HDD NTFS partition is mounted rw

Post#5 by golimar » 01 May 2013, 18:32

This one:
/dev/sda1 on /mnt/sda1 type ntfs (noatime,nodiratime,suid,dev,exec,async)
That's where the Porteus ISO is stored.

User avatar
Hamza
Warlord
Warlord
Posts: 1847
Joined: 28 Dec 2010, 07:41
Distribution: Porteus
Location: France

Re: HDD NTFS partition is mounted rw

Post#6 by Hamza » 01 May 2013, 18:55

How are you booting Porteus ?
NjVFQzY2Rg==

User avatar
Ahau
King of Docs
King of Docs
Posts: 1331
Joined: 28 Dec 2010, 15:18
Distribution: LXDE & Xfce 32/64-bit
Location: USA

Re: HDD NTFS partition is mounted rw

Post#7 by Ahau » 01 May 2013, 19:00

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
Please take a look at our online documentation, here. Suggestions are welcome!

User avatar
fanthom
Site Admin
Site Admin
Posts: 4624
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: HDD NTFS partition is mounted rw

Post#8 by fanthom » 01 May 2013, 22:32

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.
Please add [Solved] to your thread title if the solution was found.

golimar
White ninja
White ninja
Posts: 8
Joined: 25 Apr 2013, 10:01
Distribution: Win7, Debian, Knoppix, Porteus
Location: Spain

Re: HDD NTFS partition is mounted rw

Post#9 by golimar » 10 May 2013, 13:00

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=)

User avatar
fanthom
Site Admin
Site Admin
Posts: 4624
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: HDD NTFS partition is mounted rw

Post#10 by fanthom » 10 May 2013, 21:04

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).
Please add [Solved] to your thread title if the solution was found.

golimar
White ninja
White ninja
Posts: 8
Joined: 25 Apr 2013, 10:01
Distribution: Win7, Debian, Knoppix, Porteus
Location: Spain

Re: HDD NTFS partition is mounted rw [SOLVED]

Post#11 by golimar » 16 May 2013, 13:59

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!

Post Reply