LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 06-14-2008, 06:29 PM   #1
chengas123
LQ Newbie
 
Registered: Nov 2006
Posts: 28

Rep: Reputation: 15
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
 
Old 06-14-2008, 06:45 PM   #2
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
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.
 
Old 06-14-2008, 08:14 PM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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"
 
Old 06-15-2008, 08:47 PM   #4
chengas123
LQ Newbie
 
Registered: Nov 2006
Posts: 28

Original Poster
Rep: Reputation: 15
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
 
Old 06-17-2008, 06:42 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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?
 
Old 06-18-2008, 10:17 PM   #6
chengas123
LQ Newbie
 
Registered: Nov 2006
Posts: 28

Original Poster
Rep: Reputation: 15
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
 
Old 06-18-2008, 10:39 PM   #7
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 06-20-2008, 12:04 AM   #8
chengas123
LQ Newbie
 
Registered: Nov 2006
Posts: 28

Original Poster
Rep: Reputation: 15
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting Hard drive partition as writable with -rw swich using mount command fultron Linux - Newbie 12 08-16-2013 06:56 AM
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-04-2007 11:28 PM
external enclosure for an internal hard drive vs external USB hard drive powah Linux - Hardware 1 03-10-2006 09:03 AM
Making a hard drive only writable to certain users, ro to everyone else. jon_k Linux - Software 3 05-23-2005 05:42 AM
Making New Drive Readable and Writable on Windows XP and Linux tini1212 Linux - General 1 08-29-2004 06:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 01:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration