LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Mounting external usb hard drive NTFS in write mode (https://www.linuxquestions.org/questions/linux-hardware-18/mounting-external-usb-hard-drive-ntfs-in-write-mode-789807/)

zermon 02-17-2010 04:35 PM

Mounting external usb hard drive NTFS in write mode
 
Hi!

I have a problem in auto mounting external usb hard drive in
write mode. I'm using Debian Etch.
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1
/dev/hda6 /home ext3 defaults 0 2
/dev/hda5 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

zermon@dem:/etc$ mount
/dev/hda2 on / type ext3 (rw,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
/dev/hda6 on /home type ext3 (rw)
/dev/sda1 on /media/Expansion Drive type ntfs (rw,noexec,nosuid,nodev,uid=1000,gid=1000,umask=077,iocharset=utf8)


dem:/media/Expansion Drive# fdisk -l

Disk /dev/hda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 12043 96735366 7 HPFS/NTFS
/dev/hda2 12044 12894 6835657+ 83 Linux
/dev/hda3 12895 24792 95570685 5 Extended
/dev/hda5 12895 13082 1510078+ 82 Linux swap / Solaris
/dev/hda6 13083 24792 94060543+ 83 Linux
dem:/media/Expansion Drive#


Writing to etrenal USB hard drive doesn't work:


dem:/media/Expansion Drive# ls > tmp.txt
bash: tmp.txt: Read-only file system
dem:/media/Expansion Drive#


What's the problem?

raju.mopidevi 02-17-2010 06:37 PM

root account has write permissions. you can open a file manager with root permissions. and then try to write something to the harddisk.

jschiwal 02-17-2010 06:49 PM

Quote:

/dev/sda1 on /media/Expansion Drive type ntfs (rw,noexec,nosuid,nodev,uid=1000,gid=1000,umask=077,iocharset=utf8)
You might try installing the ntfs-3g package. However, the mount command does indicate that the regular user does have read/write access. Was this after manually mounting or automounting or aren't you the user with a UID of 1000?.

Look in /var/log/messages. If there is a problem with the filesystem, it may be mounted read-only instead, however even this isn't indicated by what you posted.

One thing to consider is relabeling the drive so it doesn't contain a space.

Could you post "ls -ld /media/*" to show the permissions of the mounted filesystem?

zermon 02-18-2010 02:08 PM

I did tried to write under root acount but I didn't work.
My UID is 1000. Mount command was keyed after plugging the Eternal hard drive. I installed ntfs-3g but It didn't work either.

When plugging external hard drive, this is written to /var/log/messages:


Quote:

Feb 18 21:20:24 dem kernel: usb 4-6: new high speed USB device using ehci_hcd and address 2
Feb 18 21:20:24 dem kernel: usb 4-6: configuration #1 chosen from 1 choice
Feb 18 21:20:24 dem kernel: SCSI subsystem initialized
Feb 18 21:20:24 dem kernel: Initializing USB Mass Storage driver...
Feb 18 21:20:24 dem kernel: scsi0 : SCSI emulation for USB Mass Storage devices
Feb 18 21:20:24 dem kernel: usbcore: registered new driver usb-storage
Feb 18 21:20:24 dem kernel: USB Mass Storage support registered.
Feb 18 21:20:29 dem kernel: Vendor: Seagate Model: Portable Rev: 0130
Feb 18 21:20:29 dem kernel: Type: Direct-Access ANSI SCSI revision: 04
Feb 18 21:20:29 dem kernel: SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
Feb 18 21:20:29 dem kernel: sda: Write Protect is off
Feb 18 21:20:29 dem kernel: SCSI device sda: 488397168 512-byte hdwr sectors (250059 MB)
Feb 18 21:20:29 dem kernel: sda: Write Protect is off
Feb 18 21:20:29 dem kernel: sda: sda1
Feb 18 21:20:29 dem kernel: sd 0:0:0:0: Attached scsi disk sda
Feb 18 21:20:29 dem kernel: UDF-fs: No partition found (1)
Feb 18 21:20:29 dem kernel: UDF-fs: No partition found (1)
Feb 18 21:20:30 dem kernel: Unable to identify CD-ROM format.
Feb 18 21:20:30 dem kernel: Unable to identify CD-ROM format.
Feb 18 21:20:30 dem kernel: VFS: Can't find a valid FAT filesystem on dev sda1.
Feb 18 21:20:30 dem kernel: VFS: Can't find a valid FAT filesystem on dev sda1.
Feb 18 21:20:30 dem kernel: NTFS driver 2.1.27 [Flags: R/W MODULE].
Feb 18 21:20:30 dem kernel: NTFS volume version 3.1.

Here are the permissions of the mounted file systems:

Quote:

dem:/media# ls -ld /media/*
lrwxrwxrwx 1 root root 6 2008-09-26 15:13 /media/cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2008-09-26 15:13 /media/cdrom0
drwxr-xr-x 1 zermon zermon 4096 2010-02-17 23:41 /media/Expansion Drive
lrwxrwxrwx 1 root root 7 2008-09-26 15:13 /media/floppy -> floppy0
drwxr-xr-x 2 root root 4096 2008-09-26 15:13 /media/floppy0
drwxr-xr-x 2 root root 4096 2008-09-28 23:58 /media/levy
drwxr-xr-x 2 root root 4096 2008-10-01 00:49 /media/windows
dem:/media#

At first it was
Quote:

drwx------ 1 zermon zermon 4096 2010-02-17 23:41 /media/Expansion Drive
But chmod a+rx Expansion Drive didn't help.


I tried to umount and remount the hard drive but it didn't help either:

Quote:

dem:/media# mkdir /media/usbhdrive
dem:/media# umount Expansion\ Drive/
dem:/media# ls -la
total 32
drwxr-xr-x 8 root root 4096 2010-02-18 21:41 .
drwxr-xr-x 22 root root 4096 2008-09-26 16:30 ..
lrwxrwxrwx 1 root root 6 2008-09-26 15:13 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2008-09-26 15:13 cdrom0
drwxrwxrwx 2 root root 4096 2010-02-17 00:34 Expansion Drive
lrwxrwxrwx 1 root root 7 2008-09-26 15:13 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2008-09-26 15:13 floppy0
-r-s--s--- 1 root root 0 2008-09-26 13:45 .hal-mtab-lock
drwxr-xr-x 2 root root 4096 2008-09-28 23:58 levy
drwxr-xr-x 2 root root 4096 2010-02-18 21:41 usbhdrive
drwxr-xr-x 2 root root 4096 2008-10-01 00:49 windows
dem:/media# ntfs-3g /dev/sda1 /media/usbhdrive/
$MFTMirr does not match $MFT (record 3).
Failed to mount '/dev/sda1': Input/output error
NTFS is either inconsistent, or you have hardware faults, or you have a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows TWICE. The usage of the /f parameter is very
important! If you have SoftRAID/FakeRAID then first you must activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for the details.
dem:/media#
This was written to /var/log/messages:

Quote:

Feb 18 21:41:30 dem kernel: sd 0:0:0:0: Device not ready: <6>: Current: sense key: Not Ready
Feb 18 21:41:30 dem kernel: Additional sense: Logical unit not ready, initializing command required
Feb 18 21:41:30 dem kernel: end_request: I/O error, dev sda, sector 101
Feb 18 21:41:30 dem kernel: lost page write due to I/O error on sda1
Feb 18 21:41:30 dem kernel: lost page write due to I/O error on sda1
Feb 18 21:44:32 dem kernel: fuse init (API version 7.7)

jschiwal 02-20-2010 12:26 PM

It sounds like there is a problem with the drive or the filesystem.

Did you do as suggested in the message?
Quote:

NTFS is either inconsistent, or you have hardware faults, or you have a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows TWICE. The usage of the /f parameter is very
important!


All times are GMT -5. The time now is 05:44 AM.