Author Topic: Automounting Windows partition  (Read 3541 times)

0 Members and 1 Guest are viewing this topic.

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Automounting Windows partition
« on: April 13, 2014, 06:41:19 pm »
This is kinda embarrassing, but I'm really struggling to get this Windows partition to automount correctly :(

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:
Quote
/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:
Quote
# 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!

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1834
  • Karma: 142
  • Gender: Male
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #1 on: April 13, 2014, 08:19:42 pm »
Have you tried using ntfs-3g?
Code: [Select]
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:
Code: [Select]
sudo mount -a

Offline Mark Greaves (PCNetSpec)

  • Hero Member
  • *****
  • Posts: 18277
  • Karma: 479
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #2 on: April 13, 2014, 09:47:03 pm »
As SeZo says .. make your edit to fstab .. SAVE it .. then run:
Code: [Select]
sudo mount -a
and post any errors that spits out.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #3 on: April 14, 2014, 12:12:05 am »
Go figure, it's working now following a reboot! I guess maybe one of the things I tried must have worked  ::)

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

Offline Mark Greaves (PCNetSpec)

  • Hero Member
  • *****
  • Posts: 18277
  • Karma: 479
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #4 on: April 14, 2014, 12:15:57 pm »
Did you create an fstab entry for the "Expansion" drive ? .. or is it being mounted by fuse ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #5 on: April 14, 2014, 01:04:39 pm »
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)

Offline Mark Greaves (PCNetSpec)

  • Hero Member
  • *****
  • Posts: 18277
  • Karma: 479
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #6 on: April 14, 2014, 04:12:15 pm »
You've probably got the file manager set to automount removeable media when inserted.

what's the output from:
Code: [Select]
mount
and what is your file manager ? .. nautilus ?

--
« Last Edit: April 14, 2014, 04:16:38 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #7 on: April 14, 2014, 04:30:12 pm »
File manager is Caja - the MATE fork of Nautilus. It's slightly different  :(

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  :-\

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #8 on: April 14, 2014, 05:48:10 pm »
Ok, so straight after a boot, mount returns:
Code: [Select]
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

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1834
  • Karma: 142
  • Gender: Male
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #9 on: April 14, 2014, 09:13:49 pm »
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.

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #10 on: April 15, 2014, 08:31:53 am »
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  ::)

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1834
  • Karma: 142
  • Gender: Male
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #11 on: April 15, 2014, 09:40:58 pm »
Quote
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:
Code: [Select]
sudo mkdir /media/restall/sdb1
As for mounting it in fstab try this:
Code: [Select]
/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):
Code: [Select]
sudo mount -a
See if that throws any errors

Offline Mark Greaves (PCNetSpec)

  • Hero Member
  • *****
  • Posts: 18277
  • Karma: 479
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #12 on: April 15, 2014, 10:56:30 pm »
Why not run a script that unmounts the drive at login ?
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline chemicalfan

  • Hero Member
  • *****
  • Posts: 1166
  • Karma: 36
  • Gender: Male
  • I've been here a little while!
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #13 on: April 16, 2014, 08:53:20 am »
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 :(

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

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

Offline Mark Greaves (PCNetSpec)

  • Hero Member
  • *****
  • Posts: 18277
  • Karma: 479
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • Awards
Re: Automounting Windows partition
« Reply #14 on: April 16, 2014, 11:10:00 am »
Tiz a bit of a hack .. but if you don't want to turn off automounting through caja/fuse........
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal