LinuxQuestions.org
Review your favorite Linux distribution.
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, 02:41 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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, 09:33 PM   #2
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,554
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
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, 10:15 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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, 12:54 AM   #4
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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 11:20 AM.
 
Old 05-02-2014, 10:35 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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, 05:35 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 11:53 AM   #7
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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, 07:20 AM   #8
bassplayer69
Member
 
Registered: Jul 2007
Location: In a van down by the river...
Distribution: MX Linux 21
Posts: 237

Rep: Reputation: 56
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, 11:37 AM   #9
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
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, 01:01 PM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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 11:25 AM
controlling the Windows partition joshknape Linux - Newbie 6 12-05-2005 06:05 PM
How can I access files in my Windows 98 partition from my Linux partition, /w BASH? Fabyfakid Linux - Newbie 4 09-17-2004 11:05 PM
Can't Access Windows Partition nostrum Linux - Newbie 8 06-18-2004 11:17 PM
Access to windows partition? DeadlySin3 Linux - Newbie 2 05-05-2003 10:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:43 PM.

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
Open Source Consulting | Domain Registration