:: Re: [DNG] Boot hangs with usb disk …
Góra strony
Delete this message
Reply to this message
Autor: Tito
Data:  
Dla: dng
Temat: Re: [DNG] Boot hangs with usb disk active in fstab


On 6/13/20 9:49 AM, richard lucassen via Dng wrote:
> On Sat, 13 Jun 2020 08:52:18 +0200
> "J. Fahrner via Dng" <dng@???> wrote:
>
>> Am 2020-06-13 08:25, schrieb J. Fahrner via Dng:
>>> nofail was a good hint. Now the system boots, but the usb disk is
>>> still not mounted. "mount -a" mounts it without errors after boot.
>>
>> What is the best way to run "mount -a" before any initscripts in
>> runlevel 2?
>>
>> There is a script /etc/init.d/mountall.sh, but this only runs in
>> runlevel S. Whats the purpose of this script?
>
> /etc/rcS.d/ contains scripts that run before any other runlevel. That's
> why "mountall" is there.
>
>> The script provides "mountall". Can I make daemons that need the
>> external disk dependend on "mountall".
>
> What is on that disk? Why not make that disk the root filesystem and
> pass "rootwait" to the kernel?
>
> Anyhow, you may try this:
>
> ------------------------------------------------
> #/bin/dash
>
> ### BEGIN INIT INFO
> # Provides:          disk
> # Required-Start:
> # Required-Stop:
> # Default-Start:     S
> # Default-Stop:
> # Short-Description: prepare disk at boot time
> ### END INIT INFO

>
> case $1 in
>
> start)
> # Edit this:
> /bin/mount /dev/disk /mnt/mountpoint
> ;;
>
> esac
>
> ------------------------------------------------
>
> put this in /etc/init.d/mount-disk.sh
> run: update-rc.d mount-disk.sh defaults
>
> and check if there is a link in /etc/rcS.d/ called S00mount-disk.sh
>
> Just a guess. Not tested of course.
>
> My 2cts,
>
> R.
>


Hi,
maybe rather than trying to mount the disk earlier, you could try
to spin it up so that it mounts when mountall is run.

>From https://unix.stackexchange.com/questions/10930/what-command-do-i-use-to-spin-up-a-power-up-in-standby-drive:


             Drives supporting the "Power-up in Standby" feature are supposed to spin up as soon as they get
             a command that requires reading the disk.


             like dd if=/dev/hdX of=/dev/null count=512


------------------------------------------------
#/bin/dash

 ### BEGIN INIT INFO
 # Provides:          disk
 # Required-Start:
 # Required-Stop:
 # Default-Start:     S
 # Default-Stop:
 # Short-Description: prepare disk at boot time
 ### END INIT INFO


case $1 in

start)
# Edit this:
/bin/dd if=/dev/disk of=/dev/null count=512
;;

esac
------------------------------------------------

eventually you could make this an udev/eudev rule
to be run when the drive is detected.

Untested, just my 2 cents,

Tito