Re: umount raid volume before shutdown?
On Thu, May 30, 2024 at 08:17:27PM +0100, 04-psyche.tot...@icloud.com wrote: > From my reading of /etc/rc, it seems that at shutdown or reboot, the OS will > automatically unmount everything. > > So that will unmount my encrypted partition. > > However, it does not run bioctl -d sd* for the pseudo-device. > > So I guess the question become, is it a problem to exit the system without > detaching the softraid volume via bioctl? Don't worry, the reboot code in the kernel makes sure that disks are properly unmounted and stopped. This includes softraid. If you want to look then check out vfs_shutdown() and sr_quiesce() in the source code. > Thanks! > > > > > Hi all, > > > > on my main hard drive, I have a partition `p` that I have encrypted in the > > following way: > > > > $bioctl -c C -l sd0p softraid0 > > > > -> This created the sd1 pseudo-device, on which I ran the following: > > > > $fdisk -g sd1 > > > > $disklabel -E sd1 # created partition i, to take all the space. This is the > > unique partition on this > > > > $newfs sd1a > > > > I then mount this via: > > > > $mount /dev/sd1i /decrypt > > > > > > I have two questions: > > > > - I don't want to have to unmount /decrypt before I shutdown or restart the > > computer. Does OpenBSD unmount cleanly encrypted volumes when shutting down? > > > > - what should I do with the encrypted sd0p ? Should I remove it from my > > /etc/fstab and not even mount it? Or is it fine to keep it mounted? > > > > Thanks! > > > > Jake > -- :wq Claudio
Re: umount raid volume before shutdown?
From my reading of /etc/rc, it seems that at shutdown or reboot, the OS will automatically unmount everything. So that will unmount my encrypted partition. However, it does not run bioctl -d sd* for the pseudo-device. So I guess the question become, is it a problem to exit the system without detaching the softraid volume via bioctl? Thanks! > > Hi all, > > on my main hard drive, I have a partition `p` that I have encrypted in the > following way: > > $bioctl -c C -l sd0p softraid0 > > -> This created the sd1 pseudo-device, on which I ran the following: > > $fdisk -g sd1 > > $disklabel -E sd1 # created partition i, to take all the space. This is the > unique partition on this > > $newfs sd1a > > I then mount this via: > > $mount /dev/sd1i /decrypt > > > I have two questions: > > - I don't want to have to unmount /decrypt before I shutdown or restart the > computer. Does OpenBSD unmount cleanly encrypted volumes when shutting down? > > - what should I do with the encrypted sd0p ? Should I remove it from my > /etc/fstab and not even mount it? Or is it fine to keep it mounted? > > Thanks! > > Jake
Re: umount raid volume before shutdown?
Personally, I'd just have your encrypted filesystem not listed in /etc/fstab at all, since it can't be mounted without attaching the softraid device manually anyway. Since the password is needed in every case, just attach the softraid device with bioctl and mount the filesystem with mount when needed. As a matter of hygiene, I like having /etc/rc.shutdown umount "extra" filesystems I may or may have not mounted. You may as well have it umount /decrypted and then de-attach the softraid device. I don't know if OpenBSD auto-umounts filesystems not listed on fstab during its shutdown sequence. I should try it out. 04-psyche.tot...@icloud.com wrote: Hi all, on my main hard drive, I have a partition `p` that I have encrypted in the following way: $bioctl -c C -l sd0p softraid0 -> This created the sd1 pseudo-device, on which I ran the following: $fdisk -g sd1 $disklabel -E sd1 # created partition i, to take all the space. This is the unique partition on this $newfs sd1a I then mount this via: $mount /dev/sd1i /decrypt I have two questions: - I don't want to have to unmount /decrypt before I shutdown or restart the computer. Does OpenBSD unmount cleanly encrypted volumes when shutting down? - what should I do with the encrypted sd0p ? Should I remove it from my /etc/fstab and not even mount it? Or is it fine to keep it mounted? Thanks! Jake
umount raid volume before shutdown?
Hi all, on my main hard drive, I have a partition `p` that I have encrypted in the following way: $bioctl -c C -l sd0p softraid0 -> This created the sd1 pseudo-device, on which I ran the following: $fdisk -g sd1 $disklabel -E sd1 # created partition i, to take all the space. This is the unique partition on this $newfs sd1a I then mount this via: $mount /dev/sd1i /decrypt I have two questions: - I don't want to have to unmount /decrypt before I shutdown or restart the computer. Does OpenBSD unmount cleanly encrypted volumes when shutting down? - what should I do with the encrypted sd0p ? Should I remove it from my /etc/fstab and not even mount it? Or is it fine to keep it mounted? Thanks! Jake