# Problems booting gentoo - system comes online after 30mins

## noitcelfer82

I'm a complete newbie, so if this belongs elsewhere or if there's some wiki-topic on this or spelled out clearly in the Gentoo Handbook you guys know what to do ... 

I actually did manage to fumble my way through the entire install process, so I feel *almost* special enough to tackle this:

My Gentoo system was booting fine about a week ago but now it takes about 30 to 45 minutes to boot up.  It goes through a *very* long series of errors that I can't remember because I now leave the system running and wouldn't even begin to know where to look for the logs possibly made by them.  It is so perplexing to me because once I do get into KDM and KDE, everything seems to run fine.  System seems to run a little slower than usual but otherwise I can do everything I could before.

I had one of those power outages where it flashes on and off about five times before going completely dead the night before this started happening but immediately after the power came back on I booted the system up and it was normal.  Next boot is when the problems started.

I guess, I need help on where to look for what the problem really is or what to try first.

----------

## zyko

Welcome to Gentoo! 

It's impossible to pinpoint the problem without knowing what the error messages actually say. 

I would advise you to backup important data and then run fsck on all filesystems. Do you know how to do that properly?

By the way, there is a striking discordance between the title of this thread and the content of your support request. Changing the title to something related to your problem might attract helpful users  :Wink: 

----------

## noitcelfer82

Thank you, I was originally just going to ask about recompiling the kernel because I knew I didn't have enough info to pinpoint the problem and I figured at least I'd learn something new either way! LOL.

I am going to poke around, I'm sure it's probably sad that I don't know what fsck is!!

----------

## NeddySeagoon

noitcelfer82,

There may be useful information in dmesg. That command shoous the kernel log.

Depending on your setup, the logs in /var/log may show something too.

Don't be in too much of a hurry to use fsck. It can make a bad situation worse, so be sure you have everything valuable off the install before you permit fsck to write to the filesystems.

Error message text is fairly essential in providing sound advice, so if you can't spot anything in your logs, you will need to reboot.

----------

## noitcelfer82

I think the output of dmesg actually does look similar to the errors I was seeing during boot.  I don't know which part is pertinent though and the log is very long.  The messages look about the same all the way down, so I'm just posting the end.

```
ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata2.00: cmd c4/00:08:fc:45:4f/00:00:00:00:00/e6 tag 0 pio 4096 in

         res 51/40:08:fc:45:4f/00:00:00:00:00/e6 Emask 0x9 (media error)

ata2.00: status: { DRDY ERR }

ata2.00: error: { UNC }

ata2.00: configured for PIO3

ata2: EH complete

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata2.00: cmd c4/00:08:fc:45:4f/00:00:00:00:00/e6 tag 0 pio 4096 in

         res 51/40:08:fc:45:4f/00:00:00:00:00/e6 Emask 0x9 (media error)

ata2.00: status: { DRDY ERR }

ata2.00: error: { UNC }

ata2.00: configured for PIO3

ata2: EH complete

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata2.00: cmd c4/00:08:fc:45:4f/00:00:00:00:00/e6 tag 0 pio 4096 in

         res 51/01:08:fc:45:4f/00:00:00:00:00/e6 Emask 0x1 (device error)

ata2.00: status: { DRDY ERR }

ata2.00: configured for PIO3

ata2: EH complete

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata2.00: cmd c4/00:08:fc:45:4f/00:00:00:00:00/e6 tag 0 pio 4096 in

         res 51/01:08:fc:45:4f/00:00:00:00:00/e6 Emask 0x1 (device error)

ata2.00: status: { DRDY ERR }

ata2.00: configured for PIO3

ata2: EH complete

ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0

ata2.00: cmd c4/00:08:fc:45:4f/00:00:00:00:00/e6 tag 0 pio 4096 in

         res 51/40:08:fc:45:4f/00:00:00:00:00/e6 Emask 0x9 (media error)

ata2.00: status: { DRDY ERR }

ata2.00: error: { UNC }

ata2.00: configured for PIO3

sd 1:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK

sd 1:0:0:0: [sda] Sense Key : Medium Error [current] [descriptor]

Descriptor sense data with sense descriptors (in hex):

        72 03 11 04 00 00 00 0c 00 0a 80 00 00 00 00 00 

        06 4f 45 fc 

sd 1:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed

end_request: I/O error, dev sda, sector 105858556

ata2: EH complete

sd 1:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)

sd 1:0:0:0: [sda] Write Protect is off

sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

sd 1:0:0:0: [sda] 234441648 512-byte hardware sectors (120034 MB)

sd 1:0:0:0: [sda] Write Protect is off

sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00

sd 1:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
```

----------

## zyko

 *Quote:*   

> I'm sure it's probably sad that I don't know what fsck is!!

 

I actually once formulated the hypothesis that there is an inverse correlation between knowing stuff about UNIX-like operating systems and general happyness (I had to dismiss it afterwards for reasons unrelated to the topic at hand).

Be that as it may, fsck stands for file system check. Every file system has it's own fsck tool. If you use ext2 and ext3, you should use fsck.ext2 and fsck.ext3 respectively to check them (both programs come with the standard Gentoo installation).

Enter "man fsck" in a console. That command opens the manpage (manual page) for fsck. Contrary to what users of the windows family of operating systems are used to, manuals and documentation in UNIX-derivatives are actually helpful and contain more than utter garbage. If you don't know what a command does, check its manpage (if it has one, they mostly do). Running "<command> --help" usually gives some info, too.

About your error: http://ata.wiki.kernel.org/index.php/Libata_error_messages

I've never seen t his one before, but I think you should really make a backup, as this may indicate a hardware defect. Maybe somebody else knows something specific. In any case, don't run fsck yet, as Neddy said.

You might get some additional info from your drive's SMART system. You'll need sys-apps/smartmontools. "man smartctl" will tell you the rest.

----------

## NeddySeagoon

noitcelfer82,

There are several nasty things in there.

```
sd 1:0:0:0: [sda] Add. Sense: Unrecovered read error - auto reallocate failed

end_request: I/O error, dev sda, sector 105858556 
```

summs it up nicely.

The drive was unable to read the content of sector 105858556. Whatever was there is gone for good.

However, bearing in mind your power outage and the way the power was cycled, I suspect the drive wrote incorrectly and is now detecting that. A write to the sector may well succeed, either because your have a 'soft' error or the sector will be remapped.

If you have a lot of sectors like this, retries will take a long time. Since the system tries to read these sectors on boot, they contain something useful. fsck cannot fix errors like this. All it does is to make sure the filesystem meta data is self consistant. It says nothing about user data at all.

Back up your important data, if you haven't already then run the drive vendors disk test program in its read/write mode.

This will write to the entire surface of the drive (destroying your install) and tell you what it thinks. Its possible you had a head 'crash' in which case the drive is not long for this world as the impact of the head on the platter will dislodge particles that act as a sort of grinding paste. It gets very ugly very quickly.  

Many of the vendor test programs know the warranty status of the drive under test and will offer to print a RMA for a dead/dying drive that is still within warranty. If the vendor test passes, reinstall from your backups.

----------

## Mad Merlin

 *zyko wrote:*   

>  *Quote:*   I'm sure it's probably sad that I don't know what fsck is!! 
> 
> I actually once formulated the hypothesis that there is an inverse correlation between knowing stuff about UNIX-like operating systems and general happyness (I had to dismiss it afterwards for reasons unrelated to the topic at hand).
> 
> 

 

Wouldn't that be a direct coorelation? (Increased UNIX knowledge -> increased happiness.)

----------

