Automounting Windows partition

This is kinda embarrassing, but I’m really struggling to get this Windows partition to automount correctly :frowning:

There are 2 NTFS drives with a partition each in the system, in addition to the Linux ones. One is a USB drive (called “Expansion Drive”, for some reason), that I do not want automounted. The other is an IDE drive (I think, might be SATA…), and I do want this to automount. I have already symlinked Documents, Pictures & Music from /home to the relevant My Documents folder under Windows. Problem is, I cannot get it to automount at boot. When trying to mount it post-boot, it asks for the root password - I do not want this behavior, as I will not be giving out the root password. Once the drive is manually mounted, the symlinks work perfectly.

For info, blkid:

/dev/sda1: UUID="56241CCE241CB34B" TYPE="ntfs" /dev/sda6: LABEL="swap" UUID="74283a74-60b4-4373-9e49-4806f65d0656" TYPE="swap" /dev/sda5: LABEL="boot" UUID="4ba95011-a723-4136-82f5-e91477bc44f9" TYPE="ext2" /dev/sda7: UUID="c0ed3643-7339-4087-8156-bb76d94d47f3" TYPE="ext4" /dev/sda8: LABEL="home" UUID="2b101c2c-a0f8-4707-8a15-243d15492ee4" TYPE="ext4" /dev/sdb1: LABEL="Expansion Drive" UUID="A2CC6E0BCC6DDA55" TYPE="ntfs"

/etc/fstab:

# UNCONFIGURED FSTAB FOR BASE SYSTEM proc /proc proc defaults 0 0 # /dev/sda5 UUID=4ba95011-a723-4136-82f5-e91477bc44f9 /boot ext2 rw,errors=remount-ro 0 0 # /dev/sda6 UUID=74283a74-60b4-4373-9e49-4806f65d0656 swap swap sw 0 0 # /dev/sda7 UUID=c0ed3643-7339-4087-8156-bb76d94d47f3 / ext4 rw,errors=remount-ro 0 1 # /dev/sda8 UUID=2b101c2c-a0f8-4707-8a15-243d15492ee4 /home ext4 rw,errors=remount-ro 0 0 # /dev/sda1 UUID=56241CCE241CB34B /media/restall/56241CCE241CB34B ntfs auto,rw,errors=remount-ro 0 0
(the sda1 entry was manually entered, and it doesn't work)

I should know this, but I’ve been over it trying different things, and it won’t play!

Have you tried using ntfs-3g?

UUID=56241CCE241CB34B /media/restall/56241CCE241CB34B ntfs-3g defaults,user,locale=en_GB.utf8 0 0

What are the permissions on /media/restall/56241CCE241CB34B ?

Try running(after edit) to see if it throws up some errors:

sudo mount -a

As SeZo says … make your edit to fstab … SAVE it … then run:

sudo mount -a

and post any errors that spits out.

Go figure, it’s working now following a reboot! I guess maybe one of the things I tried must have worked ::slight_smile:

It does automount the Expansion Drive on boot too now - how do I prevent that?

Did you create an fstab entry for the “Expansion” drive ? … or is it being mounted by fuse ?

Nope, the fstab is exactly as above - I haven’t changed it since posting it up.
Why would fuse be automounting it on boot? There’s nothing accessing it - it’s an external USB drive exclusively used for backup (attached 24/7 though)

You’ve probably got the file manager set to automount removeable media when inserted.

what’s the output from:

mount

and what is your file manager ? … nautilus ?

File manager is Caja - the MATE fork of Nautilus. It’s slightly different :frowning:

I’ll post up mount later when I get round there (presumably with everything mounted?) - it’ll be the last time I’ll be there till Friday though :-\

Ok, so straight after a boot, mount returns:

sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=125150,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=102372k,mode=755)
/dev/disk/by-uuid/c0ed3643-7339-4087-8156-bb76d94d47f3 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /run/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=624160k)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
/dev/sda5 on /boot type ext2 (rw,relatime,errors=remount-ro)
/dev/sda8 on /home type ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/sda1 on /media/restall/56241CCE241CB34B type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,blksize=4096)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/cgroup type tmpfs (rw,relatime,size=4k,mode=755)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,name=systemd)
/dev/sdb1 on /media/restall/Expansion Drive type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)

Looks a real mess! :-\

I want removable media mounted on insert, but want to suppress that drive from mounting except explicitly by root. Is that possible?
If not, it’s not the end of the world, mainly a safety feature to protect the backups

So why not just automount that drive (/dev/sdb1) in your fstab (if it is connected 24/7) and change the permissions for root access only for the mounted location?
If you have an entry for a device in /etc/fstab, it will prevent the OS automatic mounter from mounting that device.

I didn’t really want it mounted except for explicit backup operations, for safety reasons. If it’s mounted and there is a power failure, I don’t trust NTFS (or, Linux’s implementation of) not to screw the file system up.

What would the fstab entry be for that? I attempted one, which worked in that it didn’t automount, but then I couldn’t manually mount it either!! It threw an error basically saying there was a syntax error on the line, so I screwed it up somehow ::slight_smile:

I didn't really want it mounted except for explicit backup operations

Might be a silly question, why not just plug it in when the backup is about to be performed?

Create mount point:

sudo mkdir /media/restall/sdb1

As for mounting it in fstab try this:

/dev/sdb1 /media/restall/sdb1 ntfs-3g default,umask=077,locale=en_GB.utf8 0 0

save and then (first make sure it is not mounted already):

sudo mount -a

See if that throws any errors

Why not run a script that unmounts the drive at login ?

Won’t have access to the machine till Friday, but will check it out.
Unplugging the drive is a no-no, it’s a bit of a faff physically to access it :frowning:

Doh, hadn’t thought of that! Seems like a bit of a hack, but if I can’t get fstab to play, I’ll look at it

Tiz a bit of a hack … but if you don’t want to turn off automounting through caja/fuse…

Ok, so I’m going to go for the script idea, but I’m not sure how to give it root access under the standard logon? Entering as a Startup Application doesn’t work :frowning:
Where do I have to put the umount command? It doesn’t work under rc.local

Where do I have to put the umount command? It doesn't work under rc.local

Is it not running or just has no effect?
If it is the latter then try to mount it in fstab then let the script run to unmount it.
Otherwise the usb drive will get auto mounted with fuse after the script has run.