Solved

Write error on ntfs file system on ubuntu 8.04

Posted on 2009-05-20
12
629 Views
Last Modified: 2013-11-15
I have an external USB drive that I formatted with an msdos label and an ntfs file system.  This was done as this drive is occasionally used to share data with a windoz box and I needed something compatible with windoz.

The initial mkfs and mount worked fine and I was able to put many files onto this disk (314 GB worth).  Then I rebooted the Linux (ubuntu) system and now I can mount the disk but it is acting as if it is mounted read-only.

I cannot create files or directories on the device.  I have umounted and remounted the disk several times explicitly specifying "-o rw" but the disk always acts like a read-only device.

I am doing all the copies, mounts, etc as root, and all the file and directories are 777 so I don't think it is a permissions problem.

When I attempt to touch a file (or mkdir, or cp, or cpio, or tar) here is what I get.

touch: cannot touch `jjv': Operation not supported

Any ideas???
0
Comment
Question by:jvossler
  • 7
  • 3
  • 2
12 Comments
 

Author Comment

by:jvossler
ID: 24435482
I power cycled the device and looked in the messages file and everything looked fine:

May 20 13:30:07 pickles kernel: scsi 3:0:0:0: Direct-Access     Seagate  FreeAgent        102D PQ: 0 ANSI: 4
May 20 13:30:07 pickles kernel: sd 3:0:0:0: [sdb] 2930277168 512-byte hardware sectors (1500302 MB)
May 20 13:30:07 pickles kernel: sd 3:0:0:0: [sdb] Write Protect is off
May 20 13:30:07 pickles kernel: sd 3:0:0:0: [sdb] 2930277168 512-byte hardware sectors (1500302 MB)
May 20 13:30:07 pickles kernel: sd 3:0:0:0: [sdb] Write Protect is off
May 20 13:30:07 pickles kernel:  sdb: sdb1
May 20 13:30:07 pickles kernel: sd 3:0:0:0: [sdb] Attached SCSI disk
May 20 13:30:07 pickles kernel: sd 3:0:0:0: Attached scsi generic sg1 type 0


The /etc/mtab shows the device mounted rw

Still no joy.


0
 
LVL 8

Accepted Solution

by:
russell124 earned 250 total points
ID: 24436043
The ntfs volume might not have been removed clean the last time it was mounted in windows.  

You can clear this by re-mounting it in windows, and using the "Safely Remove Hardware" option, or you can run checkdisk on it from windows, or you can even try using ntfsfix from ubuntu, although it isn't technically a full checkdisk.

If you are worried about data integrity I would try using the windows methods.
0
 
LVL 5

Assisted Solution

by:LinuxNtwrkng
LinuxNtwrkng earned 250 total points
ID: 24437605
Make sure you have the latest ntfs-3g installed.  I've heard of this exact problem with versions released prior to October or so of 2008, which your Ubuntu is from so if it's not been updated that may explain it.

In case you need them, the commands are:
'sudo apt-get update'
'sudo apt-get upgrade'
0
 

Author Comment

by:jvossler
ID: 24437855
I did not have ntfs functionality (for mkfs.ntfs) until I installed a couple of days ago.  The system gets the update and upgrade at least once a month. I am confident that we have the latest versions.

The system did not go down cleanly when it was rebooted.  An anxious user thought it had frozen up and simply power cycled the Linux system.

Since this disk will rarely be connected to a windoz system I do not have easy access to use any of the tools suggested under windoz.

I ran ntfsfix on the device successfully, but when I then mounted it up I got the same errors.

Since this drive will only see a windoz system about once every 4 - 8 weeks I would not want to have my only option to connect to a system that isn't available.

I did notice that the mkfs command (mkfs -t ntfs /dev/sdb1) seemed to run very quickly, almost immediate.  Normally when I build a file system outside zfs it takes a bit of time.  I will rebuild the file system from scratch and see what happens, then report back.

I am open to rebuilding the disk with a different file system or other options.  The data currently on the disk is replicated elsewhere.  I need this disk to work with Linux 90%+ and occasionally connect to windoz.  So I am open to other suggestions.

Thanks
0
 

Author Comment

by:jvossler
ID: 24440598
I started building a new ntfs file system last night at about 20:30.  The process is still running at 06:30 and shows 57% completed.

The first time I did the mkfs the command returned almost immediately and now it looks to take around 17 hours completing some time near 14:30.

The output indicates that it is writing zeros

pickles:/> mkfs -t ntfs /dev/sdb1
Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes:  57%

This is my first experience dealing with windoz file systems, I'm not certain what to expect.  I usually only deal with Unix and Linux.

0
 
LVL 8

Expert Comment

by:russell124
ID: 24445715
I would suggest going with a FAT partition if you aren't going to have any files bigger than 4 GB. Both Linux and Windows have built in FAT support, and In my experience FAT is the most painless system to use when you have a drive that needs to be used across Linux / Mac / Windows.

0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:jvossler
ID: 24447424
This is what drove me to ntfs.  Many of the files are over 8GB, the the external drive at 1.5TB.

The mkfs finished at around 15:00 - taking about 18 hours to complete.

I am again testing it by creating several directories and files etc.

It seems that the disk drive has the capacity to "sleep" and any initial mount command takes a while to complete.  The first mount may error out.  Once mounted if the disk sleeps it can take up to 30 seconds to wake up after an "ls", "df" or other command to access the disk.  I will be checking with the OEM about how to limit or deactivate this feature.


I still wonder about the difference between the mkfs command returning immediately the first time.  It was a new disk and had no data on it.  Could the previous data have triggered the much monger "zeroing" of the disk when the mkfs was run?

0
 

Author Comment

by:jvossler
ID: 24456570
As I was attempting to populate the disk the disk went into the "read-only" mode again.

No reboot, no crash, just a "cpio -p.." running to the disk.  One of the directories looked interesting

ls -l
ls: cannot access Cinc: Input/output error
total 8
drwxrwxrwx  1 root root 4096 2009-05-22 03:05 .
drwxr-xr-x 40 root root 4096 2009-05-22 17:12 ..
d?????????  ? ?    ?       ?                ? Cinc
drwxrwxrwx  1 root root    0 2009-05-22 17:12 Full


I umount'ed the disk and then did a "mount -a" and everything came back and worked properly.  

Since I just purchased this 1.5TB disk, should I take it back to exchange it, or am I doing something incorrectly on this disk?
0
 

Author Comment

by:jvossler
ID: 24487525
I found the reason I was getting the write errors and occasional file system corruption.

The external USB drive I was using was the new seagate 1.5TB drive.  This external drive has a "feature" that causes the drive to sleep if ti has no activity for 15 minutes.  http://www.seagate.com/www/en-us/products/external/freeagent/freeagent_desk/

I put an NTFS file system on the drive to be able to store files over 4GB in size.  When transferring a large file (18GB - 28GB) it sometimes took longer than the "sleep" interval and the drive shutdown causing the issue.  I was running the transfer at a low priority (high nice level) in order to decrease the impact on the system.

So I returned that new drive and purchased a generic USB case for a SATA drive and purchased a 1.5TB disk drive.  This drive does not have the previous enclosures "sleep feature" to cause these problems.

Thanks for all the assistance.
0
 
LVL 5

Expert Comment

by:LinuxNtwrkng
ID: 24488862
So the drive would go to sleep even when it was being used??!!  What a POS
0
 

Author Comment

by:jvossler
ID: 24489483
Yes, according to the folks at seagate technical support. The "sleep interval" timing is triggered by something that initiates a file read or write.  Thus a long running write (or read) will allow the unit to think it should go to sleep.  If the unit sleeps while a write is in progress it has a good chance of corrupting the file system.

The support "back line storage engineer" I spoke with indicated that they did not anticipate anyone using NTFS.  When I asked about ext3, zfs, vxfs or ufs file systems he seemed to have no idea what those were and asked what version of windoz I was running.

I knew better than to pursue that line and thanked him for his time and information.
0
 
LVL 5

Expert Comment

by:LinuxNtwrkng
ID: 24489527
Oh man.  Not entirely sure whether to laugh or cry.  A shame that in this day and age a modern hard drive can be hamstrung by a ~20GB file.  I'm not even going to comment about drive "engineers" having no knowledge of filesystems, lol.  

At least you got it figured out.  Suppose that's all that really matters.  Cheers mate!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
More or less everybody in the IT market understands the basics of Networking, however when we start talking about Storage Networks, things get a bit dizzier, and this is where I would like to help.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now