windows 7 - Restrict the amount of space a folder can use

07
2014-07
  • Hashbrown

    I have a directory I have given write access to everyone and shared it for the LAN (for easy distribution of files within my sharehouse). I want to be able to remove any chance that my drive will fill up unexpectedly (by people copying copious amounts of data).
    Is there some security setting I could set on it that will reject any writes if the folder has reached a certain size?

    Another idea I thought of would be to make a new partition on the disk, and then share the resultant drive, which would have a fixed size. But that's way too inflexible (waht if I wanted to increase the cap?) and too much hassle (my physical drive is currently fully utilised as a single partition).

    Going on from that idea, though, is there a way I can create a virtual drive, and have that map to a directory? Because I'm guessing I could force the size constraint on the virtual volume and share/only write to that.

  • Answers
  • Hashbrown

    Using the notions in my answer you can use this tutorial I later found to set up a Virtual Hard Disk. It explains how you can create, initialise and format a VHD from the Computer Management tool.

    Unfortunately the VHD is stored as a file, meaning the disk actually has it's own file format and structure. So you can't access the files without going through the mounted disk. It is not a simple high-level map to a real directory on a host disk (which I'm sure there would be software out there for, and would be ideal).

    This solution works natively without third party software and is not as inflexible as creating a real partition on another drive.

  • taahir_tx10

    One way of doing so is to go to the 'properties' of the volume and configure 'Quota management.

    -> my computer -> local disk (c:) or whatever volume you are using for the share -> Right-Click Properties -> quota -> quota management


  • Related Question

    hard drive - restricting access to volumes disk even for admin account windows
  • Saideira

    I am running windows 7 x64.

    I am sharing my PC with a brother who plays a lot of games and runs all kinds of questionable programs that might have trojans, etc. A lot of that software needs admin privileges to install/run, especially the games. I want him to play games on his own disk, without damaging/corrupting my disks (which has already happened twice).

    Is it possible to completely restrict access to either folders or entire volumes / disks to processes running with admin privileges?? And admin users?

    I'm not too happy about going the encryption route as it will be impossible to access the data without Win7, and also, its time consuming - i have several large disks.

    I do not mind running two copies of Win7 in separate partitions, as long as admin account & hostile processes in one Windows cannot see the disks accessible to the other copy of Windows.

    Thanks.


  • Related Answers
  • Slartibartfast

    You do have options. You may not like them.

    1. Physical control. There are hot-swappable drive bays (which I mention because they are designed for ease of swappability, not because you would EVER want to swap them while the machine was running), or you might be able to find a physical switch that will switch between two hard drives.... I've never seen one, but I've never looked. In any case, if the drive is not attached to the machine, he can't affect it, regardless of privileges.

    2. Encryption. You can use OS-independent encryption like TrueCrypt. The time-consuming part is one-time (only for encryption), and you should be able to decrypt it later, regardless of the OS you use. I've found encrypted hard disks not to noticeably affect performance even on a limited CPU like a laptop. The down-side of this option is twofold.

      A. Since the hard drive is still connected, your brother could still corrupt the attached, encrypted disk.

      B. You are vulnerable to the "Evil Maid" attack in the situation where your brother acquires super-sophisticated spyware / viruses.

  • slhck

    You can restrict files and folders to those with admin rights. You can do this by using Windows Explorer. Right click on the file and go to Properties, Security settings. Add an Everyone group if it isn't already there. Then click Deny for each right that you want to Deny.

  • nvuono

    Another answerer suggested using hot-swappable drive bays to allow you to easily pull your HD out and switch it with your brothers but there is another solution that might be cheaper for you.

    Using a SATA power switch could allow you to toggle between 1-3 devices and depending on your electronics/soldering capabilities you could even build your own on the cheap based on this tutorial: http://www.extremetech.com/extreme/82086-build-your-own-sata-hard-drive-switch

    There are devices on Amazon which allow you to turn up to 4 drives on/off but this wouldn't necessarily protect you against your brother leaving both hard drives turned on. http://www.amazon.com/ORICO-HD-PW4101-Floppy-Switch-Control/dp/B009XPCL5U