[SOLVED] Cannot mount 2TB Western Digital USB drive as rw
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep:
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.
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).
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.
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!
Distribution: Slackware (mainly) and then a lot of others...
Posts: 855
Rep:
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'.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.