LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 04-21-2014, 03:41 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Question Controlling access to a Windows partition


When a Windows partition is mounted in a Virtualbox VM as a raw disk, users should be prevented from concurrently being able to mount the partition as read-write. Mounting as read-only probably is acceptable, although hiding the partition seems best. When the VM is not running then read-write mounts are fine. Or at least, that is how I interpret the VirtualBox user guide.

Any ideas how to ensure this?

Hiding the partition during VM usage would be acceptable I think.

This is for somebody I am helping. "Just create a new virtual disk" is not the preferred answer. Reinstalling would be a chore. Copying the partition to a virtual disk is a waste of space and the VM then needs to be re-activated because of different hardware, as well as possible licensing BS. Network file sharing won't suffice as the user needs real-time access to specific apps and not just files. Buying a new computer is not an option. Been through all of the above, hence the forum question.

The only other option is, ugh, dual boot, and at that point the user might as well stay in Windows.

This is a point-and-click user. I don't think I need to worry about the user digging deep to circumvent the protections. I just need flexible protection for either use case.

Thanks.
 
Old 04-21-2014, 10:33 PM   #2
ReaperX7
Senior Member
 
Registered: Jul 2011
Location: California
Distribution: LFS-7.6, Slackware 14.1, FreeBSD 10.1
Posts: 3,836
Blog Entries: 15

Rep: Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188Reputation: 1188
Are you using ntfs-3g or fuse?

If you're using ntfs-3g setup fstab to use "ro" variables to set it as read-only.
 
Old 04-21-2014, 11:15 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
If you're using ntfs-3g setup fstab to use "ro" variables to set it as read-only.
Then when the VM is not in use the user cannot access the partition r-w.

* VM in use, user can mount partition r-o but not r-w
* VM not in use, user can mount partition r-w

I suppose not having r-w access when mounting through a file manager is doable since the user gets r-w access when in the VM. Both options would be nice. This likely has to be scripted somehow.
 
Old 04-27-2014, 01:54 AM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Okay, I am confused. Seems the defaults for ntfs-3g is to mount read-write. Is there a global system method to change the default to read-only?

Update: Some research indicates this might be possible by writing some policy kit, udev, or udisks rules.

Last edited by Woodsman; 04-27-2014 at 12:20 PM.
 
Old 05-02-2014, 11:35 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
I found the following udev rule that will "hide" the Windows partition during general usage, such as not appearing in file managers. The partition is still discoverable and can be mounted manually, but for point-and-click users the partition essentially disappears.

/etc/udev/rules.d/99-hide-partitions.rules:
KERNEL=="sda1", ENV{UDISKS_IGNORE}="1"

I am not a udev guru and I have been looking around the web for a similar rule that does not hide the partition but only allows mounting read-only. I am not finding any such rules. Perhaps I am misunderstanding something?

Thanks.
 
Old 05-03-2014, 06:35 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,336

Rep: Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594
you don't want to mount filesystems even read-only if they are in use by a VM.

Windows caches things in memory -- thus the on-disk format is inconsistent even for read only access (it can even cause a crash unless using fuse).

The only time you won't get problems is if BOTH systems mount the filesystem read only.
 
Old 05-03-2014, 12:53 PM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
you don't want to mount filesystems even read-only if they are in use by a VM.
Oops, I only want to know how to force mounting read-only without VMs.
 
Old 05-04-2014, 08:20 AM   #8
bassplayer69
Member
 
Registered: Jul 2007
Location: In a van down by the river...
Distribution: Slackware64 14.1
Posts: 128

Rep: Reputation: 23
This may be obsolete, but can use use the ntfs driver for the time when you want ro and use ntfs-3g when you want to use rw? Has ntfs been abandoned? Just throwing it out there...
 
Old 05-04-2014, 12:37 PM   #9
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534Reputation: 534
Quote:
Has ntfs been abandoned?
I don't know, but probably.

The udev rule I shared in post #5 is good for some people as then they would not see the partition in their file managers. There are some people who have better computer skills and would at least like the partition available as read-only. The default is for ntfs-3g to make the partition available as read-write. That too is doable for people with computer skills. The majority of people with whom we are working do not have computer skills and hiding the partition is best, although they are the ones who decide their own comfort level with having access.

At the moment I am focused on just controlling access to the Windows partition and not VMs. I can't figure out how to force mounting read-only for those users who be more comfortable with that. Tinkering with fstab seems to make a mess of things and causes the partition not to appear in file managers. As all of these users are strict GUI users, their only portal to the partition is their file manager. Manual mounting with a terminal is not an option.

I am sure I am missing something obvious.
 
Old 05-04-2014, 02:01 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 2,336

Rep: Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594Reputation: 594
From the NTFS site (http://sourceforge.net/projects/linux-ntfs/)
Code:
Development on this project has moved to https://sourceforge.net/projects/ntfs-3g/
So I think it is defunct. The last update was over a year ago (January 16, 2013), and was documentation only. The previous update was in 2009.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access windows partition autophil Slackware 5 07-12-2011 12:25 PM
controlling the Windows partition joshknape Linux - Newbie 6 12-05-2005 07:05 PM
How can I access files in my Windows 98 partition from my Linux partition, /w BASH? Fabyfakid Linux - Newbie 4 09-18-2004 12:05 AM
Can't Access Windows Partition nostrum Linux - Newbie 8 06-19-2004 12:17 AM
Access to windows partition? DeadlySin3 Linux - Newbie 2 05-05-2003 11:46 AM


All times are GMT -5. The time now is 08:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration