The Official *nix Thread

Inane baanter or words of wisdom - you decide...
Post Reply
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

WiteWulf wrote:Where's your swap and/or /tmp located? If they're on /dev/sda I'd imagine that'd bring the whole system down if the drive goes into RO mode.
/tmp is on sda - all sdb holds is /home but sdb seems to be the filesystem going into RO mode. But tests seem to suggest sda is the drive failing - which would make sense as it's by far the older drive. So if /tmp is on a drive that is failing, could that cause the destination drive (which is different) to go into read-only mode without there being anything wrong with that drive?
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:So if /tmp is on a drive that is failing, could that cause the destination drive (which is different) to go into read-only mode without there being anything wrong with that drive?
What does "dmesg" or your /var/log/messages say around about that time?
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Theres lots of this in /var/log/messages: -

Code: Select all

Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869303
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869311
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869319
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869327
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869335
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869343
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVEostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869599
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869607
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869615
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869623
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869631
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
Jan  5 07:50:20 joshua11 kernel: end_request: I/O error, dev sdb, sector 203869639
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Unhandled error code
Jan  5 07:50:20 joshua11 kernel: sd 0:0:1:0: [sdb] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

Just a thought: if these are older PATA disks, I'm presuming sdb is slaved off sda's controller (primary master+slave), right?

And if both disks are throwing errors... not a chance you've knocked the ATA cable at all, is it?

If possible, try moving sdb to sdc (Secondary Master) - not forgetting to change jumpers - and see what errors you get then. I've had disk errors in the past which have been due to a dislodged ATA data cable.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Still waiting for the SMART control self-tests to finish for both drives. The CD/DVD drives are both on one ribbon connected directly to the motherboard. The IDE drives are both connected on one ribbon to a SATA/IDE PCI card - which could be faulty I suppose - and are set as Master (sda) and Slave (sdb).

EDIT: The only reason I think it might be the sda drive is the "failing to boot sometimes" thing. When copying large amounts of data to sdb, /tmp is on sda, which might do it. But all these problems would be evident if the SATA/IDE PCI card was faulty as well I guess.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Well, the SMART selftests (short, long & conveyance on sda and short and long on sdb) didn't find anything wrong, so I've unmounted sdb and and running "e2fsck -v -c -f /dev/sdb1" to see what else it can find (if anything). If nothing turns up, I'm going to change the channels for IDE from the SATA -> IDE card to the motherboard and have the CD/DVD ROM drives on the SATA -> IDE card and see if that makes a difference.

No errors yet, though.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:If nothing turns up, I'm going to change the channels for IDE from the SATA -> IDE card to the motherboard and have the CD/DVD ROM drives on the SATA -> IDE card and see if that makes a difference.
Don't forget to update /etc/fstab and other associated configs, too.

BTW: e2fsck? Using EXT2?
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Dungeon-Dave wrote:
RageMatrix wrote:If nothing turns up, I'm going to change the channels for IDE from the SATA -> IDE card to the motherboard and have the CD/DVD ROM drives on the SATA -> IDE card and see if that makes a difference.
Don't forget to update /etc/fstab and other associated configs, too.

BTW: e2fsck? Using EXT2?
EXT3, if it makes a difference.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

As a slight aside I've shunted the e2fsck process to the background as it's taking a while. Problem is, if I log out I can no longer bring the process to the foreground as the shell session associated with it is gone and the job ID is no longer valid. What if I want to bring the process back to the foreground later if I've logged out and logged back in again with a new session?

Dumb moment: - I've already done this. :oops:
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

RageMatrix wrote:As a slight aside I've shunted the e2fsck process to the background as it's taking a while. Problem is, if I log out I can no longer bring the process to the foreground as the shell session associated with it is gone and the job ID is no longer valid. What if I want to bring the process back to the foreground later if I've logged out and logged back in again with a new session?
Take a read of my Linux notes - screen is discussed in the back, I think.
User avatar
defsdoor
Baaaaaa!
Baaaaaa!
Posts: 3909
Joined: Fri Jan 30, 2004 12:26 am 0
Location: Sunny Beduff

Re: The Official *nix Thread

Post by defsdoor »

RageMatrix wrote: What if I want to bring the process back to the foreground later if I've logged out and logged back in again with a new session?
You can't - basically it's gone.

Kill fsck politely though and just start it again in a screen session as Dave mentions - it will finish up cleanly.

Normally the process would have been HUP'd when you closed it's parent shell anyway - but bash doesn't seem to do this. Usually you would have to disown %1 to keep the process running once it's parent died.
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

defsdoor wrote:Usually you would have to disown %1 to keep the process running once it's parent died.
or "nohup" it before running it in the background.

mm.. "disown" - didn't know about that. Seems it applies a retrospective nohup. Handy!
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Cheers - I've read about Screen and disown. Still seems a bit daft the way it's done now, but there ya go...
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

I promise this will be the last question for a while... :oops:

I have a secondary disk which holds a /home directory structure from a previous install of Linux. I installed a new version on a new primary drive and mounted this secondary drive as the new /home. Problem is, even though the users are the same names and I can access the home directories for the users, I cannot login directly to their home directories, as I get the following error: -

Code: Select all

login as: [me]
[me]@[machine]'s password:
Last login: Wed Jan 6 18:34:33 2010 from [machine]
Could not chdir to home directory /home/[me]: Permission denied
[[me]@[machine] /]$
Now, since the usernames are correct and the users are in the passwd file with the correct home directory paths, could it be user ID's that are different or something else? It's not as though I cannot access the home directories for the users, simply that I cannot log directly into them from a login prompt, as I can login as root, su to jon and have access to the files and directories as normal - it's just the login.

Code: Select all

[jon@joshua11 /]$ ls -la /home/
total 24
drwxr-xr-x. 5 root root 4096 2009-07-13 10:03 .
dr-xr-xr-x. 25 root root 4096 2010-01-05 16:37 ..
drwx------. 32 jon jon 4096 2010-01-06 16:14 jon
drwx------. 2 root root 4096 2010-01-05 16:39 lost+found
[jon@joshua11 /]$
The /etc/passwd file entry: -

Code: Select all

jon:x:500:500:Jonathan Baker:/home/jon:/bin/bash
The UID and GID in the /etc/passwd file is 500 for both. How can I find out what the UID and GID for the /home/jon directory is (as I assume this is the problem - perhaps different)? I have already done: -

chown -R 500 /home/jon and chgrp -R 500 /home/jon (and substituted "500" for "jon" in both instances)

...but this doesn't seem to change the login problem, although I do have ownership of the files and directories as this user and I can "su - jon" with no problems. Am I somehow missing changing the UID and GID for the hidden files even though the username is the same? Something that used the previous UID and GID in whatever scripts automatically moves your location to your home directory when you login?

...or something.

What have I broken? :)
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
JQW
Baaaaa!
Baaaaa!
Posts: 1186
Joined: Thu Feb 22, 2007 12:23 pm 0
Location: Ripon, where nothing ever happens.

Re: The Official *nix Thread

Post by JQW »

The UID and GID of the users are probably different between the two systems.

You need to change them manually for each user with find and chown/chgrp - eg:

Code: Select all

find / -gid 1034 -exec chgrp 506{} \;
Post Reply