Create a Virtual Read-Only Partition

Discussion in 'Windows 10 Tutorials' started by Neemobeer, Aug 18, 2016.

  1. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,389
    Likes Received:
    360
    This is a tutorial to setup a read only virtual partition that can be used to store data that obviously can only be read by users. Local administrators can remove the write protection in the event that new or modified data needs to be added.

    • First off you will need to open an elevated command prompt. Click the start button and type cmd, right click on "Command Prompt" and select "Run As Administrator"
    • Next you need to launch the diskpart utility by simply tying diskpart
    • read_only1.
    • Now you will need to create a virtual hard drive by typing create vdisk file="pathtofile" type=(fixed|expandable) maximum=(size in MBs)
    • read_only2.
    • After creating the virtual hard drive we need to attach it so we can work on it by typing attach vdisk, I typed the command list disk just to show the new disk
    • read_only3.
    • Now that the disk is created you need to create a partition with create part primary read_only4.
    • Now select the partition with select part 1 and the second command does a quick format with the NTFS filesystem and a label of STATIC_DATA
    • read_only5.
    • It's time to assign the virtual hard drive a drive letter, you can pick any that you like assign letter=R
    • read_only6.
    • read_only7.
    • When you open explorer you will see the virtual hard drive. It's time to copy your data over to the newly created. Make sure to leave the command prompt open, there is one more command to type after
    • Last step, back in the command prompt, type attributes disk set readonly. If you look in disk management you will see "Read Only" by it
    • read_only8.

    Steps to Modify Data

    • Open an elevated command prompt
    • Type diskpart
    • Type list disk this will give you a list of all of your disks. In my example the virtual disk is listed as disk 2 so to select it I type select disk 2
    • Now clear read-only with the following attributes disk clear readonly
    • Modify your data then type attributes disk set readonly again
     
    kemical and ussnorway like this.
  2. ussnorway

    ussnorway Windows Forum Team
    Staff Member Premium Supporter

    Joined:
    May 22, 2012
    Messages:
    2,531
    Likes Received:
    314
    interresting idea
     
  3. Neemobeer

    Neemobeer Windows Forum Team
    Staff Member

    Joined:
    Jul 4, 2015
    Messages:
    2,389
    Likes Received:
    360
    Someone requested it so I wrote the tutorial :)
     
  4. xYummy1337

    xYummy1337 New Member

    Joined:
    Sep 20, 2016
    Messages:
    6
    Likes Received:
    0
    Nice Tutorial Man :up:
     

Share This Page

Loading...