Author Topic: Stop Drives AutoMount at Startup - How?  (Read 1491 times)

Offline Proletariat

  • Full Member
  • ***
  • Posts: 51
    • My Bike
Stop Drives AutoMount at Startup - How?
« on: January 11, 2012, 04:29:37 PM »
I've got two drives that I want to stop being auto mounted at start up. Both are for windows. The system reserved & the OS.

So how do I go about it? If I right click on the drive/hide will that stop it showing up at boot? That's basically what I want.
KDE4 FullMonty 2011

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12789
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: Stop Drives AutoMount at Startup - How?
« Reply #1 on: January 11, 2012, 04:43:41 PM »
They are being auto-mounted by the /etc/fstab file.

Edit this file as root and # the lines responsible for the two drives.

Upon reboot they should not be auto-mounted anymore.

Regards.
« Last Edit: January 11, 2012, 04:48:11 PM by AndrzejL »

Offline Archie

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8583
  • Aurum nostrum non est aurum vulgi.
Re: Stop Drives AutoMount at Startup - How?
« Reply #2 on: January 11, 2012, 04:49:06 PM »
Since you did not specify your DE ...

Configure Your Desktop (SystemSettings) > Hardware > Removable Devices.

HTH
Since 2006 | LiCo 401868 | Bare Metal | What is necessary is never unwise. --Sarek, 2258.42


Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11528
  • ----IOFLU----
Re: Stop Drives AutoMount at Startup - How?
« Reply #3 on: January 11, 2012, 05:03:16 PM »
I've got two drives that I want to stop being auto mounted at start up. Both are for windows. The system reserved & the OS.

So how do I go about it? If I right click on the drive/hide will that stop it showing up at boot? That's basically what I want.

Edit /etc/fstab to add those partitions you wish to not be auto mounted. Create, and supply in /etc/fstab, the mount point directories where you want the partitions mounted when you do want them mounted, set the format as ntfs-3g, and add the mount parameters rw,user,noauto,exec,umask=000. You will need one line per partition, and different mount point directories for each. Something like /mnt/win-c, /mnt/win-d, etc, will do fine.

With these settings, you, as a normal user, will be able to mount and unmount those partitions at will, but they will not be auto mounted by root when you boot your machine.
« Last Edit: January 11, 2012, 06:48:49 PM by old-polack »
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Proletariat

  • Full Member
  • ***
  • Posts: 51
    • My Bike
Re: Stop Drives AutoMount at Startup - How?
« Reply #4 on: January 11, 2012, 05:04:59 PM »
Since you did not specify your DE ...

Configure Your Desktop (SystemSettings) > Hardware > Removable Devices.

HTH
Damn! I keep forgetting that. KDE.  ::)

I'll check all those out.
KDE4 FullMonty 2011

Offline Proletariat

  • Full Member
  • ***
  • Posts: 51
    • My Bike
Re: Stop Drives AutoMount at Startup - How?
« Reply #5 on: January 11, 2012, 05:42:53 PM »
I tried the tip from Archie. After rebooting a couple of times & going into safe mode I could not figure it out.

Here's the fstab file.
Code: [Select]
# Entry for /dev/sdb1 :
UUID=2fc71f32-bab2-4a7d-8f7a-64aca19687a8 / ext4 acl,relatime 1 1
# Entry for /dev/sdb5 :
UUID=653e47fe-e2be-4279-b851-7c8c111c3ac4 /home ext4 acl,relatime 1 2
none /proc proc defaults 0 0
# Entry for /dev/sdb6 :
UUID=9007db2f-3bed-4d8f-ae3e-def9e0dda6ce swap swap defaults 0 0
none /dev/pts devpts defaults 0 0

I can't get the hang of it as yet.

The drive I want to stop is sda.
KDE4 FullMonty 2011

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12789
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: Stop Drives AutoMount at Startup - How?
« Reply #6 on: January 11, 2012, 05:48:27 PM »
And there are no entries for it in /etc/fstab? Weird...

Tell us - after a reboot what is the output of the

Code: [Select]
su -c "mount"
command followed by the root password? Maybe the drives are not automounted and just shown as entries in the "Places" in Dolphin ready to be mounted?

Regards.


Offline Proletariat

  • Full Member
  • ***
  • Posts: 51
    • My Bike
Re: Stop Drives AutoMount at Startup - How?
« Reply #7 on: January 11, 2012, 06:00:43 PM »
OK. Get this:

Code: [Select]
/dev/sdb1 on / type ext4 (rw,relatime,acl)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw)
/dev/sdb5 on /home type ext4 (rw,relatime,acl)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sdc1 on /media/Storage type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sdd1 on /media/Libraries type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda1 on /media/System Reserved type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda2 on /media/Corsair SSD type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
KDE4 FullMonty 2011

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11528
  • ----IOFLU----
Re: Stop Drives AutoMount at Startup - How?
« Reply #8 on: January 11, 2012, 06:03:55 PM »
I tried the tip from Archie. After rebooting a couple of times & going into safe mode I could not figure it out.

Here's the fstab file.
Code: [Select]
# Entry for /dev/sdb1 :
UUID=2fc71f32-bab2-4a7d-8f7a-64aca19687a8 / ext4 acl,relatime 1 1
# Entry for /dev/sdb5 :
UUID=653e47fe-e2be-4279-b851-7c8c111c3ac4 /home ext4 acl,relatime 1 2
none /proc proc defaults 0 0
# Entry for /dev/sdb6 :
UUID=9007db2f-3bed-4d8f-ae3e-def9e0dda6ce swap swap defaults 0 0
none /dev/pts devpts defaults 0 0

I can't get the hang of it as yet.

The drive I want to stop is sda.

Drives don't mount. Filesystems in partitions mount. Even if you only have one partition covering an entire drive, in this case /dev/sda, what you'd mount is /dev/sda1, not /dev/sda.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline AndrzejL

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 12789
  • RLU #490933
    • Wordpress On The Wardrobe...
Re: Stop Drives AutoMount at Startup - How?
« Reply #9 on: January 11, 2012, 06:12:03 PM »
So the partitions /dev/sdax are being mounted even tho there is nothing in the /etc/fstab...

Old-Polack what do You make of this?

Regards.

Offline Proletariat

  • Full Member
  • ***
  • Posts: 51
    • My Bike
Re: Stop Drives AutoMount at Startup - How?
« Reply #10 on: January 11, 2012, 06:19:14 PM »
If i add lines to the fstab file & it's not right will I still be able to boot & change it back?
KDE4 FullMonty 2011

Offline AS

  • Hero Member
  • *****
  • Posts: 4111
  • Have a nice ... night!
Re: Stop Drives AutoMount at Startup - How?
« Reply #11 on: January 11, 2012, 06:43:35 PM »
So the partitions /dev/sdax are being mounted even tho there is nothing in the /etc/fstab...

Old-Polack what do You make of this?

Regards.

it could be possible that the partitions get automatically mounted from KDE, look in:
Configure your desktop -> Hardware -> Removable Devices  and check the flag "Enable automatic mounting of removable media",
or in Device Notifier -> Settings -> Automounting, which is the same config tool as above.

AS

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11528
  • ----IOFLU----
Re: Stop Drives AutoMount at Startup - How?
« Reply #12 on: January 11, 2012, 06:44:07 PM »
So the partitions /dev/sdax are being mounted even tho there is nothing in the /etc/fstab...

Old-Polack what do You make of this?

Regards.

It's because it isn't in /etc/fstab that it's being auto-mounted by HAL or udev. Neither will touch anything that's listed in /etc/fstab. Re-read what I wrote above, about mount parameters, especially the user,noauto part.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Proletariat

  • Full Member
  • ***
  • Posts: 51
    • My Bike
Re: Stop Drives AutoMount at Startup - How?
« Reply #13 on: January 11, 2012, 06:48:05 PM »
I made the changes but now I can't save the file. I tried adding permissions but no go. What's next?
KDE4 FullMonty 2011

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11528
  • ----IOFLU----
Re: Stop Drives AutoMount at Startup - How?
« Reply #14 on: January 11, 2012, 06:49:48 PM »
I made the changes but now I can't save the file. I tried adding permissions but no go. What's next?

Made what changes?
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...