LinuxQuestions.org
Visit Jeremy's Blog.
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 10-29-2012, 11:53 AM   #1
fkasmani
Member
 
Registered: Dec 2007
Posts: 176

Rep: Reputation: 17
External Hard drive - read only


Hello, looks like my external drive's file system (NTFS) is corrupted as whenever I'm connecting it, it just loads as read-only. I feel the problem has been caused 'cos the USB cable seems to be cutting out power to it at times when I accidentally touch the cable. Most of the times I even get a kernel panic when I "safely remove the drive", but:

-how can I confirm that it's the file system having got corrupt and not something else?
-Is my data at risk?
-Since this is my data backup drive, gparted says I have about 130GB free - can I partition this so I have the 130GB as another filesystem and continue with backing up to the new partition?
-Is a damaged filesystem repairable without data corruption?
-(appologies if I sound crazy here, but no harm asking) Is it possible to change the filesystem of the corrupted drive/partition?
 
Old 10-29-2012, 04:44 PM   #2
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,195

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
fdisk operates on a drive without mounting it.

The 'read only' could be a kernel thing. Have you CONFIG_NTFS_RW=y?
The kernel .config is often in /boot
Use
mount -t ntfs-3g -o rw /dev/sd?? /somewhere
 
1 members found this post helpful.
Old 11-02-2012, 01:02 PM   #3
fkasmani
Member
 
Registered: Dec 2007
Posts: 176

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by business_kid View Post
fdisk operates on a drive without mounting it.

The 'read only' could be a kernel thing. Have you CONFIG_NTFS_RW=y?
The kernel .config is often in /boot
Use
mount -t ntfs-3g -o rw /dev/sd?? /somewhere
Thanks, 'business_kid'

I didn't find any kernel .config file in /boot but I did manage to find a .config file in /usr/src/linux-headers-3.0.0-12-generic in which there is reference to CONFIG_NTFS_RW
Here's what the file reads
Code:
CONFIG_NTFS_FS=m
# CONFIG_NTFS_DEBUG is not set
# CONFIG_NTFS_RW is not set
Surprisingly, I used to regularly backup my data to this external USB drive from my Linux Mint but suddenly once I connected it and it just showed all as 'read-only' - that was why I suspected to to be a file system corruption (knowing the power-cut isue I have).

Quote:
Originally Posted by business_kid View Post
mount -t ntfs-3g -o rw /dev/sd?? /somewhere
Do I need to run this command? Hope it would not mess up any of the data in my drive.
 
Old 11-02-2012, 01:40 PM   #4
masterclassic
Member
 
Registered: Jun 2007
Distribution: Knoppix
Posts: 140

Rep: Reputation: 23
Quote:
Quote:
Quote:
Originally Posted by business_kid
mount -t ntfs-3g -o rw /dev/sd?? /somewhere
Do I need to run this command? Hope it would not mess up any of the data in my drive.
Please, look at the man page for 'mount'.
The option rw means to mount the filesystem read-write.
 
1 members found this post helpful.
Old 11-03-2012, 01:03 PM   #5
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,195

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
The config should be in the same place as the kernel as config-<kernel-version>

Quote:
# CONFIG_NTFS_RW is not set
That looks like a kernel setting which would prevent NTFS write :-o. I have that set to 'y'
 
1 members found this post helpful.
Old 11-03-2012, 01:24 PM   #6
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,374

Rep: Reputation: 587Reputation: 587Reputation: 587Reputation: 587Reputation: 587Reputation: 587
The kernel's built in NTFS driver has only limited support for writes. The comment for the CONFIG_NTFS_RW option states:
Quote:
This enables the partial, but safe, write support in the NTFS driver.

The only supported operation is overwriting existing files, without changing the file length. No file or directory creation, deletion or renaming is possible. Note only non-resident files can be written to so you may find that some very small files (<500 bytes or so) cannot be written to.
Proper write support is provided by the userspace ntfs-3g driver, which does not depend on the kernel's NTFS support at all.
 
1 members found this post helpful.
Old 11-04-2012, 07:07 AM   #7
fkasmani
Member
 
Registered: Dec 2007
Posts: 176

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by business_kid View Post
The config should be in the same place as the kernel as config-<kernel-version>
does this mean there's a problem with my setup?


Quote:
Originally Posted by business_kid View Post
That looks like a kernel setting which would prevent NTFS write :-o. I have that set to 'y'
What would I need to change it to, CONFIG_NTFS_RW=y as you previously mentioned?

I did try booting up my PC with an Ubuntu LiveCD and sure enough the external USB drive works perfectly with read/write.
 
Old 11-04-2012, 11:29 AM   #8
business_kid
Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 6,195

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
I would go by djnichols comments as he seems to have done more with this than I have recently.

That said, ignore the kernel stuff, and use ntfs-3g, making sure that ntfs-3g is installed. the site is
http://www.tuxera.com/community/ntfs-3g-advanced/

It's been so long I was mixing the older ntfs driver which never got writes sorted, and ntfs-3g which did.
So if you mount ntfs - it's the old (read only) driver
For read/write - use ntfs-3g
 
1 members found this post helpful.
Old 11-05-2012, 01:32 PM   #9
fkasmani
Member
 
Registered: Dec 2007
Posts: 176

Original Poster
Rep: Reputation: 17
Thanks so much everyone for your help.
I installed 'ntfs-3g' and as soon as I connected my external drive, I could read/write the drive contents.

Thanks once again.
 
  


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
External hard drive mounted as read-only openvista Linux - General 13 03-17-2011 10:12 AM
[SOLVED] External USB Hard Drive became read only nutjob16 Linux - Newbie 7 08-22-2010 11:48 AM
External Hard Drive has become read-only jraclarke Linux - Newbie 17 07-30-2009 06:23 AM
Can't read external hard drive alrymala Linux - Security 1 10-23-2005 01:42 PM
read external hard drive mccclxxxv Linux - Hardware 4 04-21-2004 06:15 PM


All times are GMT -5. The time now is 03:44 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration