Jump to content
  • How to Hide Windows Drive in Linux (Q4OS, Debian, Linux Mint, Ubuntu etc.)



    When using a dual-boot system with both Linux and Windows operating systems, you may encounter the need to hide certain drives from one system while using the other. This can be particularly useful in situations where you want to prevent accidental modification of critical files on a specific drive. In this guide, i will outline the steps to hide a Windows drive from the Linux operating system using udev rules.

    Step 1: Find the Drive Information

    1. Open the Gnome Disks Utility or any other disk utility tool like the KDE Partition Manager.
    2. Identify the target drive by looking for "sdX" information, where X represents a letter assigned to your drive.
    3. Take note of the drive information (e.g., sdb, sdc).

    Step 2: Determine the Drive ID

    1. Open a terminal window.
    2. Run the command:

    udevadm info --query=all --name=/dev/sdX | grep ID_SERIAL

    3. Replace "sdX" with the drive information you noted in Step 1.
    4. Note down the Drive ID that is returned in the output.

    Step 3: Create udev Rule

    1. Open a terminal and create a new file named "70-custom.rules" in the directory "/etc/udev/rules.d":

    sudo nano /etc/udev/rules.d/70-custom.rules

    2. This will open the file for editing.

    Step 4: Add Rule to Hide Drive

    1. In the text editor, add the following line:

    ENV{ID_SERIAL}=="YourDriveID", ENV{UDISKS_IGNORE}="1"

    2. Replace "YourDriveID" with the Drive ID you noted in Step 2.
    3. Save and close the file.

    Step 5: Reboot System

    1. Reboot your system for changes to take effect:

    sudo systemctl reboot

    After rebooting, the Windows drive with the specified ID should be hidden in Linux. You can verify this by checking if the drive is no longer visible in the file manager or mounted automatically.

    Conclusion

    By following the steps outlined in this guide, you can effectively hide a Windows drive from the Linux operating system using udev rules. This method provides a simple and efficient way to prevent unwanted access to specific drives while working in a dual-boot environment. Remember to carefully follow each step and verify the changes after rebooting your system to ensure that the drive is successfully concealed.


    MidnightMaster95
    • 88 views

     Share

     Share


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.