Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-12-14 Thread J. Roeleveld
On December 14, 2018 10:59:08 AM UTC, Pariksheet Nanda 
 wrote:
>Hi Joost,
>
>On Fri, Dec 14, 2018 at 12:16 AM J. Roeleveld 
>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.

Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-12-14 Thread Pariksheet Nanda
Hi Joost,

On Fri, Dec 14, 2018 at 12:16 AM J. Roeleveld  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



Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-12-13 Thread J. Roeleveld
On December 14, 2018 3:19:33 AM UTC, Pariksheet Nanda 
 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 
>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 
>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.

Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-12-13 Thread Pariksheet Nanda
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  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  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



Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-11-25 Thread Roger J. H. Welsh
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



Re: [gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-11-25 Thread J. Roeleveld
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 
 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
>NAMEUSED  AVAIL  REFER  MOUNTPOINT
>rpool  29.1G   176G96K  none
>rpool/HOME 4.98G   176G  4.98G  /home
>rpool/ROOT 7.10G   176G96K  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/swapnoneswapsw,discard0 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.

[gentoo-user] Persistence of ZFS /dev/zvol/rpool/swap

2018-11-25 Thread Pariksheet Nanda
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
NAMEUSED  AVAIL  REFER  MOUNTPOINT
rpool  29.1G   176G96K  none
rpool/HOME 4.98G   176G  4.98G  /home
rpool/ROOT 7.10G   176G96K  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/swapnoneswapsw,discard0 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