On Sun, May 5, 2019 3:57 pm, cho...@jtan.com wrote: > Thomas Frohwein writes: >> On Sun, May 05, 2019 at 08:57:55PM +0300, cho...@jtan.com wrote: >> [...] >> > Currently after every upgrade I patch /etc/rc to run /etc/rc.blockdev >> > (containing bioctl -cC -p /etc/sd0.key -l sd0a softraid0) before the >> > additional filesystems are checked or mounted. >> >> > The problem with rc.local is that it's not executed until after fsck and > mount have parsed /etc/fstab (or /etc/fstab has been parsed for them; > whatever). If they do this before sd3 exists they at worst abort and at > best don't perform their desired function on the previously-encrypted > block device (ie. the plaintext block device is not scanned and mounted > automagically and my computer boots without a /srv). >
> > My goals are: > > * /etc/rc already handles fsck of plaintext devices mentioned in > /etc/fstab. > * /etc/rc already handles mount of plaintext devices mentioned in > /etc/fstab. > * I would like to activate an encrypted/RAIDed device before /etc/rc > performs > either of those (so that code somebody else has written can do them > for me). > * /etc/rc.local is called too late. > It's really not that big of a deal to call 'fsck' and 'mount' yourself in rc.local. Unless you have system data on /srv (which would be it's own inconsistency with a standard system) needed during rc. In fstab, I set the RAID partition to noauto and disable automatic fsck. Then in rc.local call 'bioctl blah && fsck UUID.partition && mount /srv' I use a password so it's interative for me and I see if anything goes wrong. Log a message with 'logger' or send an email or whatever if something fails for your situation. Then you're done dealing with this.