How to configure or use ntfs-3g

When I tried to access, via Dolphin, my windows or data disk and also attached a third hard disk(empty) via a hard disk port-detachable like a usb port , I get this:-


  An error occurred while accessing '465.8 GiB Hard Drive', the system responded: The requested operation has failed: Error mounting /dev/sdd1 at /run/media/law/2696B94896B918EF: Command-line `mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=100,dmask=0077,fmask=0177" "/dev/sdd1" "/run/media/law/2696B94896B918EF"' exited with non-zero exit status 14: The disk contains an unclean file system (0, 0). Metadata kept in Windows cache, refused to mount. Failed to mount '/dev/sdd1': Operation not permitted The NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting), or mount the volume read-only with the 'ro' mount option. 




How do I configure or use ntfs-3g for the 2 fix disk and the detachable hard disk? I am using openSUSE 13.1.

Thanks in advance.

You need to insert the USB drive into a Windows box and run chkdsk on it, then unmount it cleanly (safely remove in Windows)

You should never remove USB drives from a computer without safely ejecting them, it leaves the FS ‘dirty’.

I came across this www.http://en.opensuse.org/SDB:NTFS which states for write support :-

The NTFS driver ntfs-3g is installed by default and write support is enabled for root only. Modify /etc/fstab line where is mentioned windows, parameter dmask=002 and parameter fmask=113 to enable user writing. For example:


#Device    Mountpoint  Filesystem  Parameters
/dev/sda1  /windows/C  ntfs-3g     user,users,gid=users,fmask=113,dmask=002,locale=en_US.UTF-8 0 0


To mount the disk:-

By adding an entry to the file /etc/fstab, the NTFS file system will be mounted automatically at boot. Make sure the mount point directory (in this example /Windows/C) exists beforehand. The most common case is that NTFS is on partition one of the first hard disk:


#Device    Mountpoint  Filesystem  Parameters
/dev/sda1  /windows/C  ntfs-3g     user,users,gid=users,umask=0002  0 0


Other options


#Device                 Mountpoint  Filesystem  Parameters
/dev/disk/by-label/win  /windows/C  ntfs-3g     user,users,gid=users,umask=0002  0 0


This is my windows 8 hard drive:-

Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt


#         Start          End    Size  Type            Name
 1           34       262177    128M  Microsoft reser 
Partition 1 does not start on physical sector boundary.
 2       264192       878591    300M  Windows recover 
 3       878592      1083391    100M  EFI System      
 4      1083392    976773119  465.3G  Microsoft basic 


In order to use this hard disk (rw enable) and make it accessible to openSUSE 13.1, I have to do the following:-

  1. Create a mount/dir point for the disk - /home/law/windows

  2. Edit the /etc/fstab file:-


/dev/disk/by-id/ata-Hitachi_HDS721050DLE630_MSK421Y21RLHRF-part2 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-Hitachi_HDS721050DLE630_MSK421Y21RLHRF-part3 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-Hitachi_HDS721050DLE630_MSK421Y21RLHRF-part1 /boot/efi            vfat       umask=0002,utf8=true  0 0
/dev/disk/by-id/ata-Hitachi_HDS721050DLE630_MSK421Y21RLHRF-part4 /home                ext4       acl,user_xattr        1 2
**/dev/disk/by-id/wwn-0x5000c50065e2091b /home/law/windows    ntfs-3g    defaults,user,gid=users,umask=0002,fmask=113,dmask=002,locale=en_US.UTF-8 0 0**



Where the id wwn-… is /dev/sda4 the home partition taken from ‘Expert Partitioner’ YaST:-

 

 


  - Device: /dev/sda 
  - Size: 465.76 GB 
  - Device Path: pci-0000:00:11.0-scsi-0:0:0:0 
  - Device ID 1: ata-ST500DM002-1BD142_Z3TX7GP4
Device ID 2: scsi-1ATA_ST500DM002-1BD142_Z3TX7GP4
Device ID 3: scsi-SATA_ST500DM002-1BD14_Z3TX7GP4
Device ID 4: wwn-0x5000c50065e2091b 


 


Then reboot the system?

Well by default ntfs is mounted as read only for normal users and if the file system is to be mounted at boot for all users then the /etc/fstab file needs to be changed. But you still have to properly shut down a file system. Windows 8.X has a nasty new feature called fast boot or some such. it does its magic by not fully shutting down and leaves the file systems dirty. This stops the ability to mount in Linux. So turn that off. Also for removable drives be sure to remove correctly!!!

That only applies if you use YaST->Partitioner to add the entry to /etc/fstab, which is not done by default.
You can just leave out all that options (or empty to options text field in YaST) and just use “defaults”, that gives all users write access as well.

This will not help you with your problem though.
Dolphin (or rather udisks2) does mount the drive with write access for the user.

But your filesystem is inconsistent that’s why NTFS-3g refuses to mount your drive, as your error message says and others have told you already.

You could try to run “ntfsfix /dev/sda4”. But it is better to just shut down Windows fully (no “fast boot”).
But again, all this is mentioned in the error message, read it again and think about it. And others have explained it already as well.

On 2014-08-25 14:56, tenderfoot246 wrote:
>
> I came across this ‘www.http://en.opensuse.org/SDB:NTFS
> (http://www.http://en.opensuse.org/SDB:NTFS)
which states for write
> support :-
>
> The NTFS driver ntfs-3g is installed by default and write support is
> enabled for root only. Modify /etc/fstab line where is mentioned
> windows, parameter dmask=002 and parameter fmask=113 to enable user
> writing. For example:

Ignore all that. Just read the error message you got:

«exit status 14: The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount. Failed to mount
‘/dev/sdd1’: Operation not permitted The NTFS partition is in an unsafe
state. Please resume and shutdown Windows fully (no hibernation or fast
restarting), or mount the volume read-only with the ‘ro’ mount option.»

If you don’t understand, read it again, and again, and again. And do
what it tells you to do: not more, not less.

That is: mount that disk IN WINDOWS, and use the “safe remove” option in
WINDOWS. You may also tell WINDOWS to do a check disk on that unit. And
make sure that Windows is not set to hibernate or “fast shutdown”.

Nothing you do in Linux will work - except mounting if read-only, if you
wish, or force clear the journal, which can, of course, destroy a lot of
data, even the entire media.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)