Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] rootwait but for other drives
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 290

PostPosted: Wed Apr 28, 2021 4:19 am    Post subject: [SOLVED] rootwait but for other drives Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Apr 28, 2021 9:39 am    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Wed Apr 28, 2021 10:07 am    Post subject: Reply with quote

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
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3879

PostPosted: Wed Apr 28, 2021 10:39 am    Post subject: Reply with quote

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
View user's profile Send private message
pa4wdh
l33t
l33t


Joined: 16 Dec 2005
Posts: 811

PostPosted: Wed Apr 28, 2021 10:48 am    Post subject: Reply with quote

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
View user's profile Send private message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 290

PostPosted: Thu Apr 29, 2021 4:31 am    Post subject: Reply with quote

OK, I'll try the init schript -> link to localmount, looks like it's the cleanest solution, isn't it?
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Thu Apr 29, 2021 7:56 am    Post subject: Reply with quote

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
View user's profile Send private message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 290

PostPosted: Thu Apr 29, 2021 11:02 am    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54220
Location: 56N 3W

PostPosted: Thu Apr 29, 2021 11:09 am    Post subject: Reply with quote

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
View user's profile Send private message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 290

PostPosted: Thu Apr 29, 2021 11:14 am    Post subject: Reply with quote

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 K8), 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
View user's profile Send private message
jpsollie
Apprentice
Apprentice


Joined: 17 Aug 2013
Posts: 290

PostPosted: Fri May 14, 2021 4:16 am    Post subject: Reply with quote

Sorry for the delayed response,
but the problem with adding an additional service fixed it ... and it's a clean solution, so I'm absolutely happy with it!
thanks guys!
_________________
The power of Gentoo optimization (not overclocked): [img]https://www.passmark.com/baselines/V10/images/503714802842.png[/img]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum