Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
This is why I mention "Head scratching", depending on the DE, the partitions may or may not be automatically mounted. None the less, inotify is likely the best tool to achieve the OPs desired objective.
The most likely behavior regardless of which DE, is that neither partition is auto-mounted until you go to access it. For lack of knowledge, my strategy is to ensure no partition is mounted before mounting the desired partition in the desired directory. Then there's another angle...
If the partition is not mounted in the default location, will you have the option of clicking on the "safely remove this drive" and getting the default desired results?
The most likely behavior regardless of which DE, is that neither partition is auto-mounted until you go to access it. For lack of knowledge, my strategy is to ensure no partition is mounted before mounting the desired partition in the desired directory. Then there's another angle...
If the partition is not mounted in the default location, will you have the option of clicking on the "safely remove this drive" and getting the default desired results?
I can see where you are coming from, but you can only do so much hand holding in advance.
At the end of the day, the OP needs to implement the solution.
I don't think it's helpful to build out a complex solution here that tackles all possible scenarios, especially if that involves reverting default behavior of the DE when that behavior can be changed to meet the requirements, or might not even be present to begin with.
But I also feel we are digressing. Didn't mean to hijack this thread...
I was just kind of pointing towards what the OP's original request suggest. That the NTFS partition cannot be accessed. I use KDE, when I plug a pen drive in, the device notifier pops up asking what to do, neither partition is mounted at this point but the device notifier icon will stay on the taskbar. If I choose to access one of the partitions 10 minutes later I click on the device notifier icon and access it. But when I safely remove the drive, it disappears and so does the device notifier icon and the only way I can remount this way is to pull the drive out and plug it back in again in order for the device notifier to reappear, and once ejected, there is no link to either partition in dolphin either.
So there is a process handling the drive when it is first attached, for lack of better words, in order for the NTFS partition to be inaccessible via GUI, you would want to "eject" the drive, then remount only the ext4 partition in another directory, at this point user's can't click on anything that will mount the NTFS partition, and you can go further, by also prohibiting users from accessing it via command line also with inotify.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.