On a laptop Lenovo z580 , installed in parallel two OS

  • Ubuntu 17.04 x86_64
  • Windows 10 64 bit

HDD is divided into such sections:

ext4 Linux partitions

  • /
  • /home

separately

  • /swap

Windows NTFS partitions

  • /sda2 - is a С:\ drive
  • /sda3 - is a D:\ drive

When working in Ubuntu you can go to the sections /dev/sda2 and /dev/sda3 via the console. Read and write information. You can also mount and unmount partitions.

Please tell me:

  1. How to isolate Ubuntu from Windows ?
  2. how to hide the /dev/sda2 and /dev/sda3 from Ubuntu ?
  3. how do Ubuntu see only ext4 partitions /home and / ?
  • Why such a perversion? It is unlikely that this will be possible without a virtual machine - andreymal
  • four
    It is not entirely clear what you want to achieve in the end. Why not just give Ubuntu users the right to mount unnecessary partitions? - mymedia
  • Sections are mounted automatically when Ubuntu starts. They can be unmounted, but they are still visible in the file manager. It is clear that with the df command, all information about partitions will appear in the console. Ultimately, I would like that when Ubuntu starts, the OS only sees its partitions and can only work with them. - Ilya Enotikov

2 answers 2

So this solution is to hide the partition of interest, and without root access, the user will not be able to work with the hidden partition.

In my example, I hide the sda2 section:

  • Opening the terminal
  • sudo -s
  • Enter the password
  • Unmounting the sda2 partition with the umount /dev/sda2 command
  • Displaying partition information in teminal the udisksctl info -b /dev/sda2 command
  • We are looking for the string IdUUID in my case, this is the IdUUID - D44E1A684E1A43A0
  • nano /etc/udev/rules.d/99-hide-partitions.rules
  • Insert the line:

    SUBSYSTEM=="block", ENV{ID_FS_UUID}=="D44E1A684E1A43A0", ENV{UDISKS_IGNORE}="1"

  • Save

  • Reboot the OS

If you type the df -h command in the terminal, the hidden section is not visible.

Important - do not forget to insert your section IdUUID .

    You can hide a partition using the Disks utility. Select the desired section, click on the button with gears, select "Change connection settings" and there uncheck the "Connect at startup" checkbox. More details here .

    • Beast Winterwolf thank you so much, the answer is found - Ilya Enotikov
    • But it will still allow sudo mount /dev/sda2 /mnt/чтототам into the console through the console (although, apparently, the author is happy with it) - andreymal
    • @andreymal that's right, or you can do the reverse operation through the same disks utility. This solution allows you to hide the section, but does not affect access rights. - Beast Winterwolf
    • @andreymal if you have access to sudo, then what is it all about? You have the right to do anything in this case. Those users from whom sections hide, usually do not have such rights. - Beast Winterwolf
    • @BeastWinterwolf Well, the title says “How to isolate Ubuntu from Windows”, and not “How to isolate a user”, I allow you to consider me a bore :) - andreymal