Disable hard disk detection or partition mounting?

Dibunom

New Member
Joined
Oct 23, 2022
Messages
5
Reaction score
0
Credits
57
Hi, I want to use Ubuntu on a pendrive and configure it so that when booting, it does not modify the hard disk partitions. To prevent me from accidentally mounting a partition, I ask, can you disable hard disk detection or partition mounting?

What should I modify?
 


First your thumb-drive has to have persistence

Then you can add them to /etc/fstab, but with options to prevent them from being automatically mounted. The option you want is noauto rather than auto. For example, to prevent a windows partition from being mounted, you could add an entry like the following:


UUID=C2A281E4A281DCF3 /media ntfs-3g defaults,noauto 0 0

You can run blkid to retrieve the partition UUID:

see also - https://help.ubuntu.com/community/UsingUUID
 

Members online


Top