* [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
@ 2018-11-25 21:36 Pariksheet Nanda
2018-11-26 3:59 ` J. Roeleveld
2018-11-26 6:03 ` Roger J. H. Welsh
0 siblings, 2 replies; 7+ messages in thread
From: Pariksheet Nanda @ 2018-11-25 21:36 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1710 bytes --]
Hi folks,
I've followed fearedbliss' guide for installing Gentoo on ZFS [1] and am
trying to understand why /dev/zol/rpool/swap does not show up on reboot
even though I saw it initially when creating the zvol and can still see it
with zfs list:
xm2 ~ # zfs list
NAME USED AVAIL REFER MOUNTPOINT
rpool 29.1G 176G 96K none
rpool/HOME 4.98G 176G 4.98G /home
rpool/ROOT 7.10G 176G 96K none
rpool/ROOT/gentoo 7.10G 176G 7.10G /
rpool/swap 17.0G 193G 354M -
xm2 ~ # ls /dev/zvol
ls: cannot access '/dev/zvol': No such file or directory
xm2 ~ #
I'm actually surprised my system boots at all, because /etc/fstab looks for
that partition to be the swap:
xm2 ~ # grep ^/dev /etc/fstab
/dev/zvol/rpool/swap none swap sw,discard 0 0
xm2 ~ #
My best guesses at the problem are either that it's udev related or that
the various ZFS services need to be better configured to expose the zvol.
I read the "Admin Documentation" links on the zfsonlinux.org website
looking for mentions on "zvol" and the only relevant section seems to be
the `zpool import` should apply `zfs share -a` to zvols [2]. Maybe I need
to run `zfs share`? But that doesn't seem to help:
xm2 ~ # zfs share rpool/swap
cannot open 'rpool/swap': operation not applicable to datasets of this type
xm2 ~ # zfs share -a
xm2 ~ # ls /dev/zvol
ls: cannot access '/dev/zvol': No such file or directory
xm2 ~ #
I haven't posted on this list in many years, so go easy on me :)
Pariksheet
[1]
https://wiki.gentoo.org/wiki/User:Fearedbliss/Installing_Gentoo_Linux_On_ZFS#Create_your_swap_zvol
[2] http://open-zfs.org/wiki/System_Administration#Boot_process
[-- Attachment #2: Type: text/html, Size: 2658 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
2018-11-25 21:36 [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap Pariksheet Nanda
@ 2018-11-26 3:59 ` J. Roeleveld
2018-11-26 6:03 ` Roger J. H. Welsh
1 sibling, 0 replies; 7+ messages in thread
From: J. Roeleveld @ 2018-11-26 3:59 UTC (permalink / raw
To: gentoo-user, Pariksheet Nanda
[-- Attachment #1: Type: text/plain, Size: 2114 bytes --]
I followed the same guide and don't have this issue.
Did you enable all ZFS services into the correct runlevels?
--
Joost
On November 25, 2018 9:36:35 PM UTC, Pariksheet Nanda <pariksheet.nanda@gmail.com> wrote:
>Hi folks,
>
>I've followed fearedbliss' guide for installing Gentoo on ZFS [1] and
>am
>trying to understand why /dev/zol/rpool/swap does not show up on reboot
>even though I saw it initially when creating the zvol and can still see
>it
>with zfs list:
>
>xm2 ~ # zfs list
>NAME USED AVAIL REFER MOUNTPOINT
>rpool 29.1G 176G 96K none
>rpool/HOME 4.98G 176G 4.98G /home
>rpool/ROOT 7.10G 176G 96K none
>rpool/ROOT/gentoo 7.10G 176G 7.10G /
>rpool/swap 17.0G 193G 354M -
>xm2 ~ # ls /dev/zvol
>ls: cannot access '/dev/zvol': No such file or directory
>xm2 ~ #
>
>I'm actually surprised my system boots at all, because /etc/fstab looks
>for
>that partition to be the swap:
>
>xm2 ~ # grep ^/dev /etc/fstab
>/dev/zvol/rpool/swap none swap sw,discard 0 0
>xm2 ~ #
>
>My best guesses at the problem are either that it's udev related or
>that
>the various ZFS services need to be better configured to expose the
>zvol.
>I read the "Admin Documentation" links on the zfsonlinux.org website
>looking for mentions on "zvol" and the only relevant section seems to
>be
>the `zpool import` should apply `zfs share -a` to zvols [2]. Maybe I
>need
>to run `zfs share`? But that doesn't seem to help:
>
>xm2 ~ # zfs share rpool/swap
>cannot open 'rpool/swap': operation not applicable to datasets of this
>type
>xm2 ~ # zfs share -a
>xm2 ~ # ls /dev/zvol
>ls: cannot access '/dev/zvol': No such file or directory
>xm2 ~ #
>
>I haven't posted on this list in many years, so go easy on me :)
>
>Pariksheet
>
>[1]
>https://wiki.gentoo.org/wiki/User:Fearedbliss/Installing_Gentoo_Linux_On_ZFS#Create_your_swap_zvol
>[2] http://open-zfs.org/wiki/System_Administration#Boot_process
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[-- Attachment #2: Type: text/html, Size: 3528 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
2018-11-25 21:36 [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap Pariksheet Nanda
2018-11-26 3:59 ` J. Roeleveld
@ 2018-11-26 6:03 ` Roger J. H. Welsh
2018-12-14 3:19 ` Pariksheet Nanda
1 sibling, 1 reply; 7+ messages in thread
From: Roger J. H. Welsh @ 2018-11-26 6:03 UTC (permalink / raw
To: gentoo-user
Hi,
I followed fearedbliss's guide a couple years back.
Here are my 2 cents.
On Sun, Nov 25, 2018 at 04:36:35PM -0500 , Pariksheet Nanda wrote:
> I'm actually surprised my system boots at all, because /etc/fstab looks for
> that partition to be the swap:
I don't think swap is required for booting.
> My best guesses at the problem are either that it's udev related or that
> the various ZFS services need to be better configured to expose the zvol.
> I read the "Admin Documentation" links on the zfsonlinux.org website
> looking for mentions on "zvol" and the only relevant section seems to be
> the `zpool import` should apply `zfs share -a` to zvols [2]. Maybe I need
> to run `zfs share`? But that doesn't seem to help:
>
It does seem to be a udev issue on your end.
This is what your udev rule should look like.
https://github.com/zfsonlinux/zfs/blob/master/udev/rules.d/60-zvol.rules.in
Check it exists.
# cat /lib/udev/rules.d/60-zvol.rules
Reload udev rules.
# rc-service udev reload
I think you also have to re-trigger the rules, which is beyond the scope
of my knowledge.
# man udevadm
If it exists on `zfs list`, your swap partition is in there somewhere.
This command will show you any swap partitions in use.
# swapon --show
Good luck!
--
Roger Welsh
fpr: 2FCB 9E31 EA77 CDEC A3AE 5DD7 D54C C777 553A 180D
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
2018-11-26 6:03 ` Roger J. H. Welsh
@ 2018-12-14 3:19 ` Pariksheet Nanda
2018-12-14 5:15 ` J. Roeleveld
0 siblings, 1 reply; 7+ messages in thread
From: Pariksheet Nanda @ 2018-12-14 3:19 UTC (permalink / raw
To: gentoo-user
Thanks, Roger and Joost!
The problem was my failed attempt at hibernation. I'm using
cryptsetup for full disk encryption and there's a limitation of not
being able to hibernate without creating a separate partition - which
I don't intend to do.
I see /dev/zvol/rpool/swap is available now after commenting out
SLEEP_MODULE="kernel" in /etc/pm/config.d/gentoo and removing
resume=/dev/zvol/rpool/swap from GRUB_CMDLINE_LINUX in
/etc/default/grub and updating grub.cfg
On Mon, Nov 26, 2018 at 1:04 AM Roger J. H. Welsh <rjhwelsh@gmail.com> wrote:
>
> If it exists on `zfs list`, your swap partition is in there somewhere.
>
> Roger Welsh
Yes, it would always show as existing with `zfs list` even when it did
not appear in /dev
On Sun, Nov 25, 2018 at 11:00 PM J. Roeleveld <joost@antarean.org> wrote:
>
> Did you enable all ZFS services into the correct runlevels?
>
> Joost
Yes:
$ rc-status -a | grep -e zfs -e '^[^ ]'
Runlevel: sysinit
Runlevel: boot
zfs-import [ started ]
zfs-mount [ started ]
Runlevel: default
zfs-zed [ started ]
zfs-share [ started ]
--snip--
Thanks again! <3
Pariksheet
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
2018-12-14 3:19 ` Pariksheet Nanda
@ 2018-12-14 5:15 ` J. Roeleveld
2018-12-14 10:59 ` Pariksheet Nanda
0 siblings, 1 reply; 7+ messages in thread
From: J. Roeleveld @ 2018-12-14 5:15 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]
On December 14, 2018 3:19:33 AM UTC, Pariksheet Nanda <pariksheet.nanda@gmail.com> wrote:
>Thanks, Roger and Joost!
>
>The problem was my failed attempt at hibernation. I'm using
>cryptsetup for full disk encryption and there's a limitation of not
>being able to hibernate without creating a separate partition - which
>I don't intend to do.
>I see /dev/zvol/rpool/swap is available now after commenting out
>SLEEP_MODULE="kernel" in /etc/pm/config.d/gentoo and removing
>resume=/dev/zvol/rpool/swap from GRUB_CMDLINE_LINUX in
>/etc/default/grub and updating grub.cfg
>
>
>On Mon, Nov 26, 2018 at 1:04 AM Roger J. H. Welsh <rjhwelsh@gmail.com>
>wrote:
>>
>> If it exists on `zfs list`, your swap partition is in there
>somewhere.
>>
>> Roger Welsh
>
>Yes, it would always show as existing with `zfs list` even when it did
>not appear in /dev
>
>
>On Sun, Nov 25, 2018 at 11:00 PM J. Roeleveld <joost@antarean.org>
>wrote:
>>
>> Did you enable all ZFS services into the correct runlevels?
>>
>> Joost
>
>Yes:
>
>$ rc-status -a | grep -e zfs -e '^[^ ]'
>Runlevel: sysinit
>Runlevel: boot
>zfs-import [
>started ]
>zfs-mount [
>started ]
>Runlevel: default
>zfs-zed [
>started ]
>zfs-share [
>started ]
>--snip--
>
>
>Thanks again! <3
>Pariksheet
Hibernation may work when building your own initramfs.
Not sure if dracut and the likes have support for it themselves.
--
Joost
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[-- Attachment #2: Type: text/html, Size: 2316 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
2018-12-14 5:15 ` J. Roeleveld
@ 2018-12-14 10:59 ` Pariksheet Nanda
2018-12-14 13:22 ` J. Roeleveld
0 siblings, 1 reply; 7+ messages in thread
From: Pariksheet Nanda @ 2018-12-14 10:59 UTC (permalink / raw
To: gentoo-user
Hi Joost,
On Fri, Dec 14, 2018 at 12:16 AM J. Roeleveld <joost@antarean.org> wrote:
>
>
> Hibernation may work when building your own initramfs.
> Not sure if dracut and the likes have support for it themselves.
>
> Joost
Yeah, I know it's possible to hibernate using my same setup using
BTRFS instead of ZFS. But after a few weeks of use BTRFS eventually
becomes slow as molasses; processes routinely get stuck in deep disk
sleep. In both cases I've been using genkernel for my initramfs.
Thanks for the encouragement to dig into the initramfs setup. I'll
report back if I have any success or questions.
Pariksheet
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap
2018-12-14 10:59 ` Pariksheet Nanda
@ 2018-12-14 13:22 ` J. Roeleveld
0 siblings, 0 replies; 7+ messages in thread
From: J. Roeleveld @ 2018-12-14 13:22 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]
On December 14, 2018 10:59:08 AM UTC, Pariksheet Nanda <pariksheet.nanda@gmail.com> wrote:
>Hi Joost,
>
>On Fri, Dec 14, 2018 at 12:16 AM J. Roeleveld <joost@antarean.org>
>wrote:
>>
>>
>> Hibernation may work when building your own initramfs.
>> Not sure if dracut and the likes have support for it themselves.
>>
>> Joost
>
>Yeah, I know it's possible to hibernate using my same setup using
>BTRFS instead of ZFS. But after a few weeks of use BTRFS eventually
>becomes slow as molasses; processes routinely get stuck in deep disk
>sleep. In both cases I've been using genkernel for my initramfs.
>Thanks for the encouragement to dig into the initramfs setup. I'll
>report back if I have any success or questions.
>
>Pariksheet
On my laptop I have full disk encryption using dmcrypt. LVM on top of that and my swap inside an LV.
My initramfs does the following:
- decrypts the disk using a typed in password
- enables LVM
- passes the swap partition to kernel resume
- if resume doesn't start, it will mount the partitions and initiates proper boot
Passing the swap partition requires identifying some codes that can differ every boot. I can post my script if you think it will help?
--
Joost
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[-- Attachment #2: Type: text/html, Size: 1738 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-12-14 13:22 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-25 21:36 [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap Pariksheet Nanda
2018-11-26 3:59 ` J. Roeleveld
2018-11-26 6:03 ` Roger J. H. Welsh
2018-12-14 3:19 ` Pariksheet Nanda
2018-12-14 5:15 ` J. Roeleveld
2018-12-14 10:59 ` Pariksheet Nanda
2018-12-14 13:22 ` J. Roeleveld
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox