# "Timed out waiting for device" when fsck

## jimmij

Every 20 boots the file system check is forced on some big partition what takes long time and during this check I get a message:

Timed out waiting for device ...

Dependency failed for...

etc.

after that I'm being asked to enter root password for maintenance.

I suppose this is systemd issue, how do I solve that?

----------

## russK

 *jimmij wrote:*   

> after that I'm being asked to enter root password for maintenance.
> 
> I suppose this is systemd issue, how do I solve that?

 

Are you stuck in the maintenance shell, or have you gotten past it?  If you know which device, you can do the fsck on the device/partition there and then quit the maintenance shell and it should continue booting.

If you have done this already and are past that point, you can change the parameters for the filesystem, I assume is ext2|3|4, read the manpage of tune2fs, options regarding the max-mount-count.  Note they caution against 0 or -1 because then it will never be checked.

If are good with both of those points, and really need to getting it past waiting for the device, sorry I'm not sure, that's a new one on me.  Are you using a UUID and maybe it doesn't know the device or partition that needs to be checked ?

HTH

----------

## jburns

Wait for fsck to complete.  If the bootstrap does not complete type <ctrl>d and the bootstrap will continue.

----------

## russK

 *jimmij wrote:*   

> Every 20 boots the file system check is forced on some big partition what takes long time and during this check I get a message:
> 
> Timed out waiting for device ...
> 
> Dependency failed for...
> ...

 

Sorry I missed that detail in my first reply.  I suspect there could be a hardware issue that happened during the check.  Not sure how you should proceed.  If it was me I might power down completely and let it cool down before restarting but seems the risk of losing data might be high so be careful, hope you have backups ...    :Shocked: 

----------

## eccerr0r

Just making sure: is the device that timed out the same disk that is being fscked?

If you "systemctl -a" after getting into a cmd prompt, do you see that the disk "failed"?

How long does it take to fsck?  I wonder if systemd is giving up on waiting for fsck since the disk is so large.  I kind of doubt it however, then again, I've never had to fsck a large disk on systemd yet...  All my systemd machines have ssd or journaling filesystems..

Perhaps I could force fsck on my 2T disk and see if it would behave the same way...

----------

## jimmij

 *jburns wrote:*   

> Wait for fsck to complete.  If the bootstrap does not complete type <ctrl>d and the bootstrap will continue.

 

Yes, but shouldn't systemd know that fsck is running and wait for it to complete?

----------

## jimmij

 *eccerr0r wrote:*   

> Just making sure: is the device that timed out the same disk that is being fscked?

 

Yes, this is the same disk.

 *Quote:*   

> 
> 
> If you "systemctl -a" after getting into a cmd prompt, do you see that the disk "failed"?
> 
> How long does it take to fsck?  I wonder if systemd is giving up on waiting for fsck since the disk is so large.  I kind of doubt it however, then again, I've never had to fsck a large disk on systemd yet...  All my systemd machines have ssd or journaling filesystems..
> ...

 

It takes a few minutes, and it is ext4 fs, so a fs with journaling.

----------

## jimmij

 *russK wrote:*   

>  *jimmij wrote:*   Every 20 boots the file system check is forced on some big partition what takes long time and during this check I get a message:
> 
> Timed out waiting for device ...
> 
> Dependency failed for...
> ...

 

There are not any hardware problems, everything works perfectly.

The only issue is every 20 reboots when fsck runs automatically and the systemd doesn't manage to start some services because time runs down waiting for mounted root file system.

----------

## eccerr0r

Ah... so this is the root filesystem that needs to be fscked?

See if /usr/lib/systemd/system/systemd-fsck-root.service contains a low timeout (TimeoutSec), if you need to edit it,

cp /usr/lib/systemd/system/systemd-fsck-root.service /etc/systemd/system/

vi /etc/systemd/system/systemd-fsck-root.service

There's also a systemd-fsck@.service for non-root.

Then again, I thought 0 (Gentoo default?) was to never timeout ... As I've yet to see this particular issue (and yes this would be very annoying) I haven't had to fix it yet...

Hmm... now if it's mount that's timing out...  I'm surprised it would let it get that far due to fsck dependency, and it's something else that's wrong...

----------

## NerdIII

I have the same issue. Every 20 boots or so, I get dropped to the maintenance prompt. While the filesystem is checked the screen shows the fsck service (no timeout) and the sda1 (EFI) and sda3 (root) services (90s timeout) waiting on it. When the 90 seconds are up the maintenance prompt is shown. Why don't services get the timeouts of their dependencies added upon theirs until the dependency is up? I.e. I would have expected the sda1/sda3 services to have unlimited time until fsck is done.

I don't know if I should rely solely on the journal for my 500 GiB ext4 partition as some people propose. Does everyone else have disks where fsck completes within 90s? Are there other solutions?

----------

