LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-22-2010, 10:59 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Rep: Reputation: 177Reputation: 177
Cannot mount 2TB Western Digital USB drive as rw


I have a 2TB Western Digital USB drive. This has been previously connected to a Windows box without problem. I have connected it to my Linux slackware distro computer. It mounts OK, but is only mounted read-only. Kernel version is Linux 2.6.21.5-smp.

fdisk -l gives:

Disk /dev/sda: 1999.6 GB, 1999696297984 bytes
255 heads, 63 sectors/track, 243115 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 243116 1952827392 7 HPFS/NTFS

mount command: mount /dev/sda1 /mnt, or mount -w /dev/sda1 /mnt. After mounting, mount with no args gives:

/dev/sda1 on /mnt type ntfs (rw)

which is similar to the /etc/mtab entry:

/dev/sda1 /mnt ntfs rw 0 0

but trying to delete a file on the drive gives: "rm: cannot remove `/mnt/webBackup.zip': Read-only file system"

doing
mount -o remount /mnt
or
mount -o remount,rw /mnt
gives:

mount: block device /dev/sda1 is write-protected, mounting read-only

doing another mount (no args) then gives:
/dev/sda1 on /mnt type ntfs (ro)

device ls -l is:

brw-rw---- 1 root disk 8, 1 2010-12-22 10:47 /dev/sda1

What's going on here? Why can't I mount this things read-write? As I said, I can read and write just fine to this device mounted on windows. I can even read/write to this Windows mounted drive from linux when I mount it using mount.cifs

Also, mounting a USB flash drive as: mount /dev/sdb1 /mydir, works fine. I can read/write to /mydir.

Confused! Desperate! Lonely! Help!
 
Old 12-22-2010, 11:06 AM   #2
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
what about ntfs-3g?
 
Old 12-22-2010, 11:18 AM   #3
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Look at the permissions closely. Only root and root group can read/write to the device.
You can (if you want) change the read/write permissions so that the users can write to it.
Hope this helps.
BTW slackware by default has ntfs read/write so that is not a concern.
 
Old 12-22-2010, 11:35 AM   #4
Dani1973
Member
 
Registered: Dec 2010
Distribution: Debian testing
Posts: 148

Rep: Reputation: 16
How safe is it to write to NTFS under linux?
Wouldn't it be better to format the drive back to FAT32 if it is used under windows and linux?

I guess the drive accidently got formatted to ntfs because when you try to format a partition larger then 32GB under Windows XP/2003 and older it only gives you NTFS as a solution (not sure about Vista, but I think 7 has not that 'problem' anymore).

EDIT : I created another topic for my question -> http://www.linuxquestions.org/questi...-fat32-851840/

Last edited by Dani1973; 12-22-2010 at 11:48 AM.
 
Old 12-22-2010, 11:51 AM   #5
Woodypecker
Member
 
Registered: Mar 2006
Location: Austria
Distribution: Mandriva/Debian
Posts: 104

Rep: Reputation: 17
Which slackware version?

2.6.21 is pretty aged, I am uncertain about ntfs-3g support with that old version of slackware.
You may try to fetch and compile ntfs-3g but I would first update the kernel and related stuff.
I am using a 32G usb-stick and a 500G usb harddrive, both formatted with ntfs (allows files >4G)
and occasionally it's good to attach them to a windows box to do a fsck and defrag the harddrive,
but otherwise there is no trouble.
No, the standard ntfs driver does only allow overwriting of single files - and as I remember,
some additional parameter is needed to enable even that.
 
Old 12-22-2010, 04:11 PM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
SilverBack: I am trying to read/write this drive as root.

Dani1973: This drive contains large backup files and disk images some of which are nearly 300GB, so I don't think FAT32 is going to be what I want.

HasC, Woodypecker: this 2.6.21 kernel is older, but not *that* old. It is from mid 2007 so 3 1/2 years ... I'm willing to try the ntfs-3g thing on this version as a first try, but this system is a running web/database server, so I'd rather not attempt an update to the kernel right at this moment.

Do you think that support for the ntfs file system is the likely culprit rather than something funky with the drive? Is it possible that the 2.6.21 version of the ntfs driver only supported ntfs in read-only mode? Would this not be documented somewhere? Would there be any harm in downloading and building ntfs-3g? So many questions!
 
Old 12-23-2010, 03:07 AM   #7
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
If you say the drive works fine with windows then the drive is ok. I am a bit comfused by the part where you said you can read/write to mydir....
If you mount the drive at a point then read/write done at the moint point should be done on the drive itself.
One more thing I can think about is doing a fdisk...
As far as the drive is concerned I guess 1TB should be supported but I am not sure.
Another thing I can think about that makes a file undeletable is 'chattr'. Can you check that too with 'lsattr'.
 
Old 12-23-2010, 03:57 AM   #8
honeybadger
Member
 
Registered: Aug 2007
Location: India
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855

Rep: Reputation: Disabled
Just thought of something that might help. Try and 'disown <filename>' and then try to delete it.
 
Old 12-23-2010, 09:51 AM   #9
Woodypecker
Member
 
Registered: Mar 2006
Location: Austria
Distribution: Mandriva/Debian
Posts: 104

Rep: Reputation: 17
Hi ... so if you already have such big files on that drive you don't want to change the filesystem on it - ntfs-3g is what you want.
I am no slackware user, but at http://www.tuxera.com/community/ntfs-3g-faq/#fuse26 they tell kernels >2.6.20 should be safe. You may need to compile the "fuse" module so make sure you have your kernel sources and build environment, but slackware should have that installed by default
 
Old 12-27-2010, 03:23 PM   #10
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,555

Original Poster
Rep: Reputation: 177Reputation: 177
The solution was, indeed, to install ntfs-3g. Apparently the standard ntfs driver does not support write operations (at least with my kernel version). Here are the instructions for installing ntfs-3g: http://www.slackwiki.org/NTFS-3G. I can't find where I read it, but somewhere in the docs it mentioned that this release of ntfs-3g is supported for kernels as far back as 2.6.16, so, no need to upgrade the whole kernel for this.

btw - SilverBack, when I said I could "read/write to mydir ..." I meant that I could install a regular ole USB flash drive (e.g. 8GB stick) and read/write it. That was just a test to see that I could write at all with the USB device.

Thanks all!
 
  


Reply



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
[SOLVED] Can't mount Western Digital Elements 2TB external hard drive ChiVampir Linux - Hardware 10 07-22-2018 08:37 AM
Cannot mount Western Digital 2.0 USB 2TB on Ubuntu Lucid shayno90 Ubuntu 7 10-28-2010 07:19 PM
How to mount Western Digital USB 2.0 2TB on Debian Lenny 5.0.6 shayno90 Linux - Hardware 4 10-22-2010 06:36 AM
Can't access Western Digital USB fat32 drive Azul Rondo Linux - Hardware 5 09-17-2009 12:44 AM
How to mount Western Digital External Drive previously used on Windows System? bliss4one MEPIS 7 09-16-2008 05:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:55 PM.

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