You are not logged in.

#1 2014-04-28 07:45:03

Hari701
Member
Registered: 2014-04-16
Posts: 9

[SOLVED] Can't mount NTFS hard disk

I have a separate 250GB hard disk running Windows 7. It used to get automatically mounted when I was using Gnome as my DE. But I switched to Xfce and now I am unable to access that hard disk. I installed Gnome disk utility and it could detect the hard disk, but it was not able to mount it saying "Not authorised to perform operation (udisks-error-quark, 4)". I then tried mounting it manually through the terminal and got these:

$ sudo mount -t ntfs /dev/sdb /mnt

[sudo] password for hari: 
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

After which I tried mounting just one of the partitions:

sudo mount -t ntfs /dev/sdb5 /mnt

This seemed to work, but when I opened my file manager, it wasn't there and I couldn't even get into the /mnt directory. The folder icon had a cross icon attached to it (not sure what that means).


I am completely new to Linux, so please be patient with me! smile

Last edited by Hari701 (2014-04-29 05:48:18)

Offline

#2 2014-04-28 08:15:37

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] Can't mount NTFS hard disk

Let's go through this step by step.

Hari701 wrote:

I have a separate 250GB hard disk running Windows 7. It used to get automatically mounted when I was using Gnome as my DE. But I switched to Xfce and now I am unable to access that hard disk.

That's odd. Gnome and XFCE both use gvfs for mounting external filesystems. Is it automounted in /etc/fstab? Or did it just appear in the pane in your window manager?

Hari701 wrote:

I installed Gnome disk utility and it could detect the hard disk, but it was not able to mount it saying "Not authorised to perform operation (udisks-error-quark, 4)".

Did you mount if from within the gnome hard disk utility?

I'm suspecting you do not have a policykit daemon running. Could you give the output of:

ps aux | grep -i polkit

please?

Hari701 wrote:

I then tried mounting it manually through the terminal and got these:

$ sudo mount -t ntfs /dev/sdb /mnt

[sudo] password for hari: 
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

Two points:

  • You are mounting a hd directly, that is not common. Most hd's have partition's. Then the start of the hd contains the partition layout. The native kernel ntfs driver expects a ntfs signature, and not a partition table. The ntfs signatures are located at the start of the partition

  • You are using the ntfs driver which is able to read but is very limited in writing. It only allows writing if the original and new file have the same size. This very specific restriction is used for some corner case scenario's and not suitable for regular end user usage

Hari701 wrote:

After which I tried mounting just one of the partitions:

sudo mount -t ntfs /dev/sdb5 /mnt

Two points:

  • Now you are mounting a partition which is valid and ok. Good.

  • You are still using the native ntfs driver. Not good.

To be able to 'freely' write to a ntfs partition, Linux has a seperate ntfs driver called 'ntfs-3g'. Ntfs-3g is a driver implemented in userspace (a contraire to ntfs). Userspace filesystems are generally handled by the fuse kernel module.

Hari701 wrote:

This seemed to work, but when I opened my file manager, it wasn't there and I couldn't even get into the /mnt directory.

Correct, mouting filesystems by root will only allow root access (main rule). Native linux filesystem who have a native implementation of DAC (default access control system for Linux) are the exception. You can set default uid and gid value's like this:

sudo mount -t ntfs /dev/sdb5 /mnt -o uid=username,gid=username

And now using ntfs-3g:

sudo mount -t ntfs-3g /dev/sdb5 /mnt -o uid=username,gid=username
Hari701 wrote:

The folder icon had a cross icon attached to it (not sure what that means).

Which means that your access is denied as a normal user. You are not allowed to open a directory (executable bit). In order to list files in a directory you need to be:

  • able to open it: executable bit

  • be able to list files: read bit

Hari701 wrote:

I am completely new to Linux, so please be patient with me! smile

I hope I did okay.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#3 2014-04-28 09:43:38

Hari701
Member
Registered: 2014-04-16
Posts: 9

Re: [SOLVED] Can't mount NTFS hard disk

Rexilion wrote:

Let's go through this step by step.

Hari701 wrote:

I have a separate 250GB hard disk running Windows 7. It used to get automatically mounted when I was using Gnome as my DE. But I switched to Xfce and now I am unable to access that hard disk.

That's odd. Gnome and XFCE both use gvfs for mounting external filesystems. Is it automounted in /etc/fstab? Or did it just appear in the pane in your window manager?

It just appeared in the pane of my window manager and I had full access to it after typing the password it asked for every time I open it for the first time in a session.

Rexilion wrote:

Did you mount if from within the gnome hard disk utility?

I'm suspecting you do not have a policykit daemon running. Could you give the output of:

ps aux | grep -i polkit 

please?

Yeah, I mounted it from within the hard disk utility. As for the output of that command:

$ ps aux | grep -i polkit

polkitd    449  0.0  0.4 515296 16956 ?        Ssl  07:20   0:04 /usr/lib/polkit-1/polkitd --no-debug
hari      6413  0.0  0.0  10680  1076 pts/1    S+   14:07   0:00 grep -i polkit

I'm guessing I don't have that daemon installed?

Rexilion wrote:

Correct, mouting filesystems by root will only allow root access (main rule). Native linux filesystem who have a native implementation of DAC (default access control system for Linux) are the exception. You can set default uid and gid value's like this:

sudo mount -t ntfs /dev/sdb5 /mnt -o uid=username,gid=username

And now using ntfs-3g:

sudo mount -t ntfs-3g /dev/sdb5 /mnt -o uid=username,gid=username

I tried and got this error for both of those commands:

[sudo] password for hari: 
mount: failed to parse mount options

Offline

#4 2014-04-28 09:48:21

o_caino
Member
Registered: 2013-06-06
Posts: 166

Re: [SOLVED] Can't mount NTFS hard disk

Offline

#5 2014-04-28 10:04:16

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] Can't mount NTFS hard disk

Hari701 wrote:

I tried and got this error for both of those commands:

[sudo] password for hari: 
mount: failed to parse mount options

My bad, uid= and gid= are expecting numbers corresponding to your id. You can use

id ~username

to find out.

Try installing lxpolkit and make sure that it's icon is ticked in XFCE session management. Then log out and back in and you should be fine.


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#6 2014-04-28 12:18:40

Hari701
Member
Registered: 2014-04-16
Posts: 9

Re: [SOLVED] Can't mount NTFS hard disk

Here is what I got now:

$ id ~hari
id: /home/hari: no such user

I installed lxpolkit, did what you instructed and I was able to mount the hard disk using the disk utility! smile But I still want to be able to do it manually and also automount it without the disk utility, so that I won't be needing the disk utility any more. Is that possible? Also, the names displayed for each partition in my file manager seem to be their UUIDs. How can I change those to something of my choice?

Offline

#7 2014-04-28 13:23:05

Rexilion
Member
Registered: 2013-12-23
Posts: 784

Re: [SOLVED] Can't mount NTFS hard disk

It would be

id hari

(my bad)

Good thing the lxpolkit thing worked smile . I think thunar can mount these partitions as well, they should be listed inside the left pane.

You can use automount with systemd, look here. Then the partition will be mounted (and unmounted?). I also thought they would go 'the whole mile', but systemD will not automount yet.

EDIT: Maybe you need to install thunar-volman.

Last edited by Rexilion (2014-04-28 13:23:41)


fs/super.c : "Self-destruct in 5 seconds.  Have a nice day...\n",

Offline

#8 2014-04-29 03:33:14

Hari701
Member
Registered: 2014-04-16
Posts: 9

Re: [SOLVED] Can't mount NTFS hard disk

Problem solved! All along, I assumed gvfs was already installed as it was "used by Thunar" for automounting, as the wiki says. But I suddenly got a doubt and noticed it wasn't installed! After installing it and rebooting, the other hard disk got automounted! big_smile

Thanks a lot for helping! smile

Offline

Board footer

Powered by FluxBB