LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-16-2011, 06:36 PM   #1
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Rep: Reputation: 0
External hard drive mounted as read-only


I administer a remote server via SSH that runs CentOS 5.5. I have been unsuccessful in all my attempts to write to two different external USB hard drives with a single ext3 partition when logged in as root.

When attempting to create a "test" directory I get one of two messages:

Quote:
[root@neon usb]# mkdir test
mkdir: cannot create directory `test': Input/output error
[root@neon usb]# mkdir test
mkdir: cannot create directory `test': Read-only file system

Both drives *appear* to have filesystem issues. When I run an fsck on either drive, I get:

Quote:
[root@neon /]# e2fsck /dev/sda1
e2fsck 1.39 (29-May-2006)
/dev/sda1: recovering journal
/dev/sda1 contains a file system with errors, check forced.
Pass 1: Checking inodes, blocks, and sizes
Keep in mind this is a newly-formatted, empty drive.

Not putting stock in the odds that I've had two hard drives (different sizes and brands) with the exact same hardware problem, I'm going to assume this is a software issue, although maybe it isn't. Hence, my post in "Linux - General". I've heard talk elsewhere of controller (chipset) issues coming into play. Is this valid?

Okay, here's the information you'll need to make a diagnosis....

Here's the output of a "df -h" command:

Quote:
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
70G 54G 13G 82% /
/dev/md0 99M 24M 70M 26% /boot
tmpfs 760M 0 760M 0% /dev/shm
/dev/sda1 367G 195M 348G 1% /mnt/usb

Here's the contents of my /etc/fstab:

Quote:
[root@neon usb]# cat /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
/dev/md0 /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hdd3 swap swap defaults 0 0
LABEL=SWAP-hda3 swap swap defaults 0 0
/dev/sda1 /mnt/usb ext3 defaults 0 0

Here's the output of "cat /etc/mtab":

Quote:
/dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/md0 /boot ext3 rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
none /proc/sys/fs/binfmt_misc binfmt_misc rw 0 0
sunrpc /var/lib/nfs/rpc_pipefs rpc_pipefs rw 0 0
/dev/sda1 /mnt/usb ext3 rw 0 0

Here's the output of a mount command:

Quote:
[root@neon usb]# mount
/dev/mapper/VolGroup00-LogVol00 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md0 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
/dev/sda1 on /mnt/usb type ext3 (rw)

Here's the output of fdisk on the device in question:

Quote:
[root@neon /]# fdisk /dev/sda

The number of cylinders for this disk is set to 48641.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sda: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 48641 390708801 83 Linux

I've got someone with access to the box if necessary. But it might take days to implement solutions since this isn't his full-time job. Remote solutions are, therefore, preferable.

Many thanks!

Last edited by openvista; 03-16-2011 at 06:40 PM.
 
Old 03-16-2011, 06:41 PM   #2
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
I should also add that I've disabled SELinux and that has no effect.
 
Old 03-16-2011, 06:45 PM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,357
Blog Entries: 2

Rep: Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979
Since you have two devices with the same error I don't think that your USB-disks themselves are faulty, I think that an other device is faulty. I would check at least this:
1. Are they connected with the same cable? If so, change it and give it another try.
2. Are the drives always connected to the same USB-port? If so change it and give it another try.
3. Check the drives on a different machine, to be sure that they are not the culprit.
4. Try a different device on this machine.
 
Old 03-16-2011, 06:56 PM   #4
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TobiSGD View Post
Since you have two devices with the same error I don't think that your USB-disks themselves are faulty, I think that an other device is faulty. I would check at least this:
1. Are they connected with the same cable? If so, change it and give it another try.
2. Are the drives always connected to the same USB-port? If so change it and give it another try.
3. Check the drives on a different machine, to be sure that they are not the culprit.
4. Try a different device on this machine.
Answers:
1. Only one drive is in use at this time. Unsure if a different cable was used.

2. Uncertain if a different port was used each time.

3. They were previously in use as Windows drives. They've been reformatted (using CentOS) and only now are they having issues.

4. I have a 3rd drive but do you really think it's 2 bad drives?

As I said, I'm 400 miles away from this server. I can have someone attempt the above solutions but it will take time.

Any software suggestions to try in the meantime?

Thanks so much for your help.
 
Old 03-16-2011, 07:04 PM   #5
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, Mint
Posts: 7,322

Rep: Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380
I am asking this only because it has not been directly addressed and apologize if I've missed something obvious.

When the drives were partitioned and a file system type selected, was mkfs run on them to create the file system?
 
Old 03-16-2011, 07:16 PM   #6
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
@frankbell:

I'm on my 2nd hard drive. The first hard drive I partitioned myself using fdisk utility. No go. The 2nd time around a colleague partitioned it and I'm not sure exactly how he went about it. Is there some kind of advantage to using mkfs? Do you have a command suggestion? If so, I can pretty easily repartition the drive.
 
Old 03-16-2011, 07:17 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,357
Blog Entries: 2

Rep: Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979
For 1+2, you have to make that sure. For 3, frankbell's question is a good one. For 4, such coincidences happen very seldom, but it is the simplest way to use a known-good device on that machine to make sure that the drives are not the culprit.
 
Old 03-16-2011, 07:20 PM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Gentoo
Posts: 15,357
Blog Entries: 2

Rep: Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979Reputation: 3979
Quote:
Originally Posted by openvista View Post
Is there some kind of advantage to using mkfs?
Without using mkfs there will be no filesystem on the disks, if you didn't use a partitioning tool like GParted that formats automatically. The command should look like this:
Code:
mkfs -t ext3 /dev/sda1
Assuming that sda1 is the partition on the external disk.
 
Old 03-16-2011, 07:25 PM   #9
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
@TobiSGD

I apologize for the confusion. I thought frankbell was only asking about how it was partitioned, not how it was formatted. I missed that part. It is formatted ext3 and an "ls -la" command produces the following:


Quote:
[root@neon usb]# ls -la
total 28
drwxr-xr-x 3 root root 4096 Mar 12 12:21 .
drwxr-xr-x 3 root root 4096 Feb 12 15:19 ..
drwx------ 2 root root 16384 Mar 12 12:21 lost+found
 
Old 03-16-2011, 07:30 PM   #10
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
That directory listing is from root, by the way (the drive is mounted as /mnt/usb).
 
Old 03-16-2011, 07:35 PM   #11
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Full disclosure: I'm a web admin and not accustomed to formatting hard drives since I don't have access to any servers. Usually that is done by others. As is adding hard drives or other hardware. So please bear with me if I miss some obvious questions. In this particular instance, the client is running a backup server (the computer in question) in their office. There is a tech who moonlights for them who can swap hardware when he gets a chance but otherwise, this is all on me.
 
Old 03-16-2011, 07:45 PM   #12
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Okay, I've asked the tech who is local to the server to try TobiSGD's suggestions. I'll report back with results once I have them.
 
Old 03-16-2011, 10:49 PM   #13
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by openvista View Post
Okay, I've asked the tech who is local to the server to try TobiSGD's suggestions. I'll report back with results once I have them.
Okay, here's the report from my man on the ground:

Quote:
Hi John,

The drives have used different cables. One that was for the LaCie drives previously connected, and a seperate cable for the WD Passport 400G currently connected. The WD passport has been in use by me for several months. I reformated it after copying anything pertinent off the drive I still needed.

We can ask Jim to connect the WD Passport to a different USB port on the linux system. We should umount before of course.

I just spent a few minutes reformatting to vfat and trying some dir and file creates & deletes (as root). No problems. Last messages in /var/log/messages were 20+ minutes ago when the drive was formatted ext3.
So it appears he can write to the drive in FAT but not EXT3.

Thoughts?
 
Old 03-17-2011, 10:12 AM   #14
openvista
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
A quick update from my tech who was at the server this morning.... Apparently, if you disable the ehci_hcd module, which disables USB 2 in favor of 1.1, the drive is writeable under ext3. This suggests that something like the bug involving nForce2 chipsets (nVidia motherboard) applies. However, I'm awaiting confirmation of which motherboard chipset the server uses.

Because this is a backup server that transfers multiple gigabytes of data in a single script execution I can't fall back on USB 1.1 permanently. The workaround seems limited to the current session only which is also unacceptable. Perhaps I'm misunderstanding the workaround or someone knows of a more elegant, permanent software solution?

Thanks for all the help thus far!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hotplug of external hard drive to USB 2.0 port affecting other mounted devices timonlq Linux - Hardware 2 08-17-2009 12:25 PM
External Hard Drive is mounted but I can't access - pls help! (newbee) esspy4 Linux - Hardware 13 07-12-2007 04:51 AM
NTFS external hard drive, mounted but not accessible jmrother Linux - Newbie 7 02-01-2006 09:41 PM
External Hard Drive Not Mounted during Install chazdg Mandriva 5 10-30-2003 11:02 AM
Hard drive mounted in read only (After long uptime...) otjervaag Linux - Laptop and Netbook 10 10-04-2003 08:34 PM


All times are GMT -5. The time now is 11:58 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