View previous topic :: View next topic |
Author |
Message |
jpsollie Apprentice
Joined: 17 Aug 2013 Posts: 290
|
Posted: Wed Apr 28, 2021 4:19 am Post subject: [SOLVED] rootwait but for other drives |
|
|
I have a SAS controller which is somewhat slow at initializing the SCSI bus.
The SSD drive for /home is located up there (though / is not).
Can I ask openrc to wait a few minutes before deciding the mount is invalid?
I know of the rootwait parameter in the kernel, but is this also feasible for other devices? _________________ The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
Last edited by jpsollie on Fri May 14, 2021 4:16 am; edited 1 time in total |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Wed Apr 28, 2021 9:39 am Post subject: |
|
|
Hi
please check the config in
Code: |
/etc/conf.d/localmount
|
If not successful then [lease use a cronjob @reboot to mount /home.
As a dirty trick check if using _netdev as a mount option for /home in fstab will give some time for your slow controller.... _________________
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Wed Apr 28, 2021 10:07 am Post subject: |
|
|
jpsollie,
An ever dirtier trick is to not use fstab to mount home.
Do it in local instead.
The most primitive form in a script that does
Code: | #/bin/bash
sleep 120
mount ... |
Wait 120 sec and do the mount. That's yuck but it will delay the login prompt, so you can login as a user when home mounts
Better is a script that checks for the /dev entry, if its missing, sleeps for a second and checks again.
Once the device appears, mounts it and exits.
You will want a timeout too, or the system will wait forever. There will be not login prompt.
That's beyond my bash skills but someone else will be along soon. :) _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
alamahant Advocate
Joined: 23 Mar 2019 Posts: 3879
|
Posted: Wed Apr 28, 2021 10:39 am Post subject: |
|
|
Neddy something like that
Code: |
wait_for_home () {
count=0
while [ ! -e /dev/disk/by-uuid/<uuid-of-home> ];do
sleep 1
let "count=count+1"
[ count -eq 15 ] && exit
done
}
wait_for_home
.
.
.
|
? _________________
|
|
Back to top |
|
|
pa4wdh l33t
Joined: 16 Dec 2005 Posts: 811
|
Posted: Wed Apr 28, 2021 10:48 am Post subject: |
|
|
You could also make a new init script with a function like alamahant posted as start function (you could even use variables for timeout and the device to look for) and make localmount depend on that via rc.conf. _________________ The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world
My shared code repository: https://code.pa4wdh.nl.eu.org
Music, Free as in Freedom: https://www.jamendo.com |
|
Back to top |
|
|
jpsollie Apprentice
Joined: 17 Aug 2013 Posts: 290
|
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Thu Apr 29, 2021 7:56 am Post subject: |
|
|
jpsollie,
There you go, I'm pleased you didn't use my answer.
alamahant,
/dev/disk/by-uuid/<uuid-of-home> requires that udev be running to create the symlink.
That would fail fore me as I don't have either devtmpfs in my kernel, nor udev.
Then, I'm kind of old fashioned, or a corner case, depending on your point of view. :)
I would have to run the mount command and look at the exit code.
As least, I can't think of things here that come and go with devices. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
jpsollie Apprentice
Joined: 17 Aug 2013 Posts: 290
|
Posted: Thu Apr 29, 2021 11:02 am Post subject: |
|
|
NeddySeagoon wrote: | jpsollie,
There you go, I'm pleased you didn't use my answer.
alamahant,
/dev/disk/by-uuid/<uuid-of-home> requires that udev be running to create the symlink.
That would fail fore me as I don't have either devtmpfs in my kernel, nor udev.
Then, I'm kind of old fashioned, or a corner case, depending on your point of view.
I would have to run the mount command and look at the exit code.
As least, I can't think of things here that come and go with devices. |
maybe dmesg | grep "SSD ID" would also do the trick _________________ The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img] |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54220 Location: 56N 3W
|
Posted: Thu Apr 29, 2021 11:09 am Post subject: |
|
|
jpsollie,
This is Gentoo. There are lots of ways to do almost everything.
They are all equally correct too.
Just like there are no failed Gentoo installs. For sure there are varying degrees of success but even those users that decide that Gentoo is not for them have learned something, so that's a degree of success too. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
jpsollie Apprentice
Joined: 17 Aug 2013 Posts: 290
|
Posted: Thu Apr 29, 2021 11:14 am Post subject: |
|
|
NeddySeagoon wrote: | jpsollie,
This is Gentoo. There are lots of ways to do almost everything.
|
and that's why I've been running Gentoo since initial AMD64 (athlon 64 K, and recently ported it to NEO3 (still working on the wiki page, though)
NeddySeagoon wrote: |
They are all equally correct too.
|
Not sure about that: aside from "coding in C", as long as syntax is correct, you also have a "Code of Conduct", which explains what kind of layout you should use ...
[/quote] _________________ The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img] |
|
Back to top |
|
|
jpsollie Apprentice
Joined: 17 Aug 2013 Posts: 290
|
|
Back to top |
|
|
|