LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   Need help making external hard drive writable (https://www.linuxquestions.org/questions/suse-opensuse-60/need-help-making-external-hard-drive-writable-649328/)

chengas123 06-14-2008 06:29 PM

Need help making external hard drive writable
 
Hi,
I plugged in my external hard drive and can't write to it. When I tried to change the permissions, I got the message: "chmod: changing permissions of '/media/externalHardDrive': Read-only file system". Is there a permanent fix I can apply so that it will be writable each time I plug it in? The drive is formatted as NTFS and I'm running openSuse 10.3.

Thanks,
Ben

pinniped 06-14-2008 06:45 PM

Check that you have the latest ntfs driver and create an fstab entry. The older driver would not allow anyone buy root to write because there were some data integrity issues.

Some things to try:
specify the user/group and permissions in the fstab entry.

jschiwal 06-14-2008 08:14 PM

Install the fuse and ntfs-3g packages. That will allow you to write to an ntfs filesystem. I'm not certain if it would automount that way, but clicking on properties on the icon, you may be able to change how it mounts. If not,
you can create an fstab entry that will allow you to mount the drive.

I'd recommend using udevinfo to determine the UUID of the filesystem and use that instead of the device node. This is because the next time you plug in the usb drive, it may be assigned to another device node.

Suppose that it is assigned /dev/sdb1:
udevinfo -q env -n /dev/sdb1

Then use the FS_UUID entry and create an /etc/fstab line like:
Code:

UUID=<UUID#>      /mnt/usbdrive ntfs-3g rw,nosuid,nodev,noauto,users,uid=<username>,fmask=0177,dmask=0077,utf8 0 0
This will make you the owner of the mounted filesystem. The noauto will prevent the drive from being mounted when you boot up. That way booting won't fail if the drive isn't present. The "users" combined with "uid=<username>" will allow you to issue the command "mount /mnt/usbdrive" without needing to su to root.

The write support for ntfs-3g is better than the kernel's ntfs modules support. ( You may need to modprobe ntfs however).
You also need to modprobe the "fuse" module as well.

You may want to add the "fuse" and "ntfs" modules to the /etc/sysconfig/kernel file so you won't need to modprobe them in the future.

Code:

## Type:                string
## ServiceRestart:      boot.loadmodules
#
# This variable contains the list of modules to be loaded
# once the main filesystem is active
# You will find a few default modules for hardware which
# can not be detected automatically.
#
MODULES_LOADED_ON_BOOT="fuse ntfs"


chengas123 06-15-2008 08:47 PM

Hi,
Thanks for the help with the fstab entry. I think ntfs-3g and fuse are installed by default because I already had them. Do I need to do anything to make the fstab change go into effect (like rebooting)?
Also, is there a way to have the drive be automounted when I plug it in?

Thanks,
Ben

jschiwal 06-17-2008 06:42 PM

If I remember correctly, I needed to install the fuse and ntfs-3g packages. You may also need to modprobe them, run "depmod -a" and then "mkinitrd" or add these modules to the /etc/sysconfig/kernel file so that they are loaded when you boot.

You could try making sure that the fuse module is loaded before inserting the drive. The automount system may detect it then. In that case you don't need an entry in /etc/fstab.

There may be another module that ntfs depends on such as utf8 or nls_utf16 that ntfs depends on.

Try "sudo tail -f /var/log/messages" and then insert the drive. Do you see any error messages?

chengas123 06-18-2008 10:17 PM

Thanks for showing me how to tail the logs. It does look like there was some problem because of the line that says: "Jun 18 23:29:51 chameleon-htpc kernel: NTFS-fs error (device sdc1): load_system_files(): $LogFile is not clean. Mounting read-only. Mount in Windows."


Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: new high speed USB device using ehci_hcd and address 8
Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: new device found, idVendor=13fd, idProduct=1340
Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: new device strings: Mfr=1, Product=2, SerialNumber=3
Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: Product: External
Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: Manufacturer: Generic
Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: SerialNumber: WD-WCASU2365975
Jun 18 23:29:49 chameleon-htpc kernel: usb 5-6: configuration #1 chosen from 1 choice
Jun 18 23:29:49 chameleon-htpc kernel: scsi8 : SCSI emulation for USB Mass Storage devices
Jun 18 23:29:49 chameleon-htpc kernel: usb-storage: device found at 8
Jun 18 23:29:49 chameleon-htpc kernel: usb-storage: waiting for device to settle before scanning
Jun 18 23:29:50 chameleon-htpc kernel: scsi 8:0:0:0: Direct-Access Generic External 1.04 PQ: 0 ANSI: 4
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] 976773168 512-byte hardware sectors (500108 MB)
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Write Protect is off
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Mode Sense: 21 00 00 00
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Assuming drive cache: write through
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] 976773168 512-byte hardware sectors (500108 MB)
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Write Protect is off
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Mode Sense: 21 00 00 00
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Assuming drive cache: write through
Jun 18 23:29:50 chameleon-htpc kernel: sdc: sdc1
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: [sdc] Attached SCSI disk
Jun 18 23:29:50 chameleon-htpc kernel: sd 8:0:0:0: Attached scsi generic sg3 type 0
Jun 18 23:29:50 chameleon-htpc kernel: usb-storage: device scan complete
Jun 18 23:29:50 chameleon-htpc kernel: printk: 175 messages suppressed.
Jun 18 23:29:50 chameleon-htpc kernel: NTFS-fs warning (device sdc1): parse_options(): Option utf8 is no longer supported, using option nls=utf8. Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.
Jun 18 23:29:50 chameleon-htpc kernel: NTFS volume version 3.1.
Jun 18 23:29:51 chameleon-htpc kernel: NTFS-fs error (device sdc1): load_system_files(): $LogFile is not clean. Mounting read-only. Mount in Windows.
Jun 18 23:29:51 chameleon-htpc hald: mounted /dev/sdc1 on behalf of uid 1000

jschiwal 06-18-2008 10:39 PM

One disadvantage to using the NTFS filesystem is that you need to repair the filesystem in Windows. I think that the ntfs-3g program has an ntfs-fix program but this will only fix the filesystem enough that windows will find it and repair it.

It may be a matter that the drive wasn't ejected properly before being disconnected. You may need to wait a few seconds for the cache to clear even if the OS says otherwise. The cache is at a lower level and the drive itself may have some internal cached memory that needs to be written.

chengas123 06-20-2008 12:04 AM

Thanks. I used the Windows chkdsk program and it looks like I'm further along. I had to run it twice, but I'm no longer getting the error message about the drive being mounted as read-only. Konqueror now at least will let me try to copy files to the disk, but it still bombs out. Here's what I get if I try on the commandline:

bmccann@chameleon-htpc:~/Documents/My Music/flac> sudo cp -r George\ Clinton\ -\ Greatest\ Funkin\'\ Hits\ \(1996\)/ /media/500GB\ External\ Hard\ Drive/My\ Documents/My\ Music/flac/
cp: cannot create directory `/media/500GB External Hard Drive/My Documents/My Music/flac/George Clinton - Greatest Funkin\' Hits (1996)': Operation not permitted


The new output to /var/log/messages is below:
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: new high speed USB device using ehci_hcd and address 10
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: new device found, idVendor=13fd, idProduct=1340
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: new device strings: Mfr=1, Product=2, SerialNumber=3
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: Product: External
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: Manufacturer: Generic
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: SerialNumber: WD-WCASU2365975
Jun 20 01:06:12 chameleon-htpc kernel: usb 5-6: configuration #1 chosen from 1 choice
Jun 20 01:06:12 chameleon-htpc kernel: scsi10 : SCSI emulation for USB Mass Storage devices
Jun 20 01:06:12 chameleon-htpc kernel: usb-storage: device found at 10
Jun 20 01:06:12 chameleon-htpc kernel: usb-storage: waiting for device to settle before scanning
Jun 20 01:06:13 chameleon-htpc kernel: scsi 10:0:0:0: Direct-Access Generic External 1.04 PQ: 0 ANSI: 4
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] 976773168 512-byte hardware sectors (500108 MB)
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Write Protect is off
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Mode Sense: 21 00 00 00
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Assuming drive cache: write through
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] 976773168 512-byte hardware sectors (500108 MB)
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Write Protect is off
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Mode Sense: 21 00 00 00
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Assuming drive cache: write through
Jun 20 01:06:13 chameleon-htpc kernel: sdc: sdc1
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: [sdc] Attached SCSI disk
Jun 20 01:06:13 chameleon-htpc kernel: sd 10:0:0:0: Attached scsi generic sg3 type 0
Jun 20 01:06:13 chameleon-htpc kernel: usb-storage: device scan complete
Jun 20 01:06:13 chameleon-htpc kernel: NTFS-fs warning (device sdc1): parse_options(): Option utf8 is no longer supported, using option nls=utf8. Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.
Jun 20 01:06:13 chameleon-htpc kernel: NTFS volume version 3.1.
Jun 20 01:06:13 chameleon-htpc hald: mounted /dev/sdc1 on behalf of uid 1000


All times are GMT -5. The time now is 04:31 PM.