Needing a larger swap than the default I followed the steps at: http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide#ZFS_Swap_and_Dump_Devices and at: http://docs.sun.com/app/docs/doc/819-5461/ggvlr?a=view Namely: zfs create -V 2G -b 4k rpool/swap (I''ve also tried just zfs create -V 2G rpool/swap) pfexec swap -a /dev/zvol/dsk/rpool/swap This works during the current session. After a reboot this swap is no longer available. pfexec swap -a /dev/zvol/dsk/rpool/swap gives the following error message: /dev/zvol/dsk/rpool/swap: No such file or directory However it does exist: rodney at opensolaris:~$ ls -la /dev/zvol/dsk/rpool/swap lrwxrwxrwx 1 root root 35 Oct 1 22:34 /dev/zvol/dsk/rpool/swap -> ../../../../devices/pseudo/zfs at 0:1c I have to execute pfexec zfs destroy -r rpool/swap and start again after each reboot. It doesn''t help adding an entry to /etc/vfstab. A similar issues happens with rpool/dump. I''m using the OSOL release (build 124 32 bit) following the /dev repo not SXCE. I''m running a zfs root pool mirror in case that''s relevant: rodney at opensolaris:~$ zpool status -v pool: rpool state: ONLINE scrub: none requested config: NAME STATE READ WRITE CKSUM rpool ONLINE 0 0 0 mirror ONLINE 0 0 0 c8t0d0s0 ONLINE 0 0 0 c8t0d0p2 ONLINE 0 0 0 errors: No known data errors Is this a ZFS bug or am I missing something critical? -- This message posted from opensolaris.org
Darren J Moffat
2009-Oct-14 12:09 UTC
[zfs-discuss] ZFS Swap Doesn''t Survive Reboot - OSOL-124
Rodney wrote:> Needing a larger swap than the default I followed the steps at: > http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide#ZFS_Swap_and_Dump_Devices > and at: > http://docs.sun.com/app/docs/doc/819-5461/ggvlr?a=view > > Namely: > > zfs create -V 2G -b 4k rpool/swap (I''ve also tried just zfs create -V 2G rpool/swap)You should also add -o primarycache=none> pfexec swap -a /dev/zvol/dsk/rpool/swap > This works during the current session. > > After a reboot this swap is no longer available. > pfexec swap -a /dev/zvol/dsk/rpool/swap gives the following error message: > /dev/zvol/dsk/rpool/swap: No such file or directoryCorrect, unlike filesystems for swap you still have to update the legacy /etc/vfstab file. It isn''t a bug but it could certainly be better. /sbin/swapadd could look for swap volumes or libzfs could ''swap -a'' them as it finds them. The problem with that though is that today ZFS doesn''t know that the ZVOLs are used for swap and doesn''t actually care. -- Darren J Moffat
Cindy Swearingen
2009-Oct-14 18:54 UTC
[zfs-discuss] ZFS Swap Doesn''t Survive Reboot - OSOL-124
Hi Rodney, I''ve not seen this problem. Did you install using LiveCD or the automated installer? Here are some things to try/think about: 1. After a reboot with no swap or dump devices, run this command: # zfs volinit If this works, then this command isn''t getting run on boot. Let me know the outcome. 2. Your mirrored root pool devices, c8t0d0s0 and c8t0d0p2, might overlap. s0 is slice 0 and p2 is an fdisk partition that might contain s0. I would recommend detaching c8t0d0p2 and attach a different slice, s1 or s7. Don''t use the p* devices at all, other than letting the Solaris installer install into them. Mirroring to a slice on a different disk would be best. 3. We''re not sure if detaching c8t0d0p2 also solves the swap/dump devices from disappearing, but if they overlap, then maybe it will. Cindy On 10/14/09 04:34, Rodney wrote:> Needing a larger swap than the default I followed the steps at: > http://www.solarisinternals.com/wiki/index.php/ZFS_Troubleshooting_Guide#ZFS_Swap_and_Dump_Devices > and at: > http://docs.sun.com/app/docs/doc/819-5461/ggvlr?a=view > > Namely: > > zfs create -V 2G -b 4k rpool/swap (I''ve also tried just zfs create -V 2G rpool/swap) > pfexec swap -a /dev/zvol/dsk/rpool/swap > This works during the current session. > > After a reboot this swap is no longer available. > pfexec swap -a /dev/zvol/dsk/rpool/swap gives the following error message: > /dev/zvol/dsk/rpool/swap: No such file or directory > > However it does exist: > rodney at opensolaris:~$ ls -la /dev/zvol/dsk/rpool/swap > lrwxrwxrwx 1 root root 35 Oct 1 22:34 /dev/zvol/dsk/rpool/swap -> ../../../../devices/pseudo/zfs at 0:1c > > I have to execute pfexec zfs destroy -r rpool/swap and start again after each reboot. > It doesn''t help adding an entry to /etc/vfstab. > > A similar issues happens with rpool/dump. > > I''m using the OSOL release (build 124 32 bit) following the /dev repo not SXCE. > > I''m running a zfs root pool mirror in case that''s relevant: > > rodney at opensolaris:~$ zpool status -v > pool: rpool > state: ONLINE > scrub: none requested > config: > > NAME STATE READ WRITE CKSUM > rpool ONLINE 0 0 0 > mirror ONLINE 0 0 0 > c8t0d0s0 ONLINE 0 0 0 > c8t0d0p2 ONLINE 0 0 0 > > errors: No known data errors > > Is this a ZFS bug or am I missing something critical?
Darren J Moffat
2009-Oct-15 09:30 UTC
[zfs-discuss] ZFS Swap Doesn''t Survive Reboot - OSOL-124
Cindy Swearingen wrote:> Hi Rodney, > > I''ve not seen this problem. > > Did you install using LiveCD or the automated installer? > > Here are some things to try/think about: > > 1. After a reboot with no swap or dump devices, run this command: > > # zfs volinitNote that volinit is gone in future builds. -- Darren J Moffat
Thanks Cindy and Darren. I installed from the 2009.06 LiveCD and updated via the /dev repo to build 124 (and each in between over time). After a reboot zfs volinit runs. After that I can add the zfs swap manually. What''s the next step to make it run at boot? And if it''s gone in future builds that what replaces it? Regarding mirroring to a slice on the same disk it''s because I''m using a laptop with 1 hard disk. I created two primary partitions using 50% each. I installed OSOL on the first and mirrored to the 2nd primary partition. I''m using compression. I thought this was a good way to get redundancy while also gaining back a lot of the lost space. Thanks again.. Rod -- This message posted from opensolaris.org
Darren J Moffat
2009-Oct-15 11:51 UTC
[zfs-discuss] ZFS Swap Doesn''t Survive Reboot - OSOL-124
Rodney wrote:> Thanks Cindy and Darren. > > I installed from the 2009.06 LiveCD and updated via the /dev repo to build 124 (and each in between over time). > > After a reboot zfs volinit runs. After that I can add the zfs swap manually. > > What''s the next step to make it run at boot?Update /etc/vfstab with a like something like this: /dev/zvol/dsk/rpool/swap - - swap - no - replacing rpool/swap with what ever your dataset for swap is.> And if it''s gone in future builds that what replaces it?The work that the *private* ''zfs volinit'' step did is all now automatic and done in the kernel. Massive boot time improvements for system with very large numbers of ZVOLs.> Regarding mirroring to a slice on the same disk it''s because I''m using a laptop with 1 hard disk. > I created two primary partitions using 50% each. I installed OSOL on the first and mirrored to the 2nd primary partition. I''m using compression. I thought this was a good way to get redundancy while also gaining back a lot of the lost space.I''ve tried that in the past (about 3 years a go IIRC) and it just hurts performance. Since you can''t physically replace either side of the mirror you will get the same level of protection (maybe even better) and better performance by setting the property copies to 2 (eg ''zfs set copies=2 rpool''). -- Darren J Moffat
Cindy Swearingen
2009-Oct-15 20:11 UTC
[zfs-discuss] ZFS Swap Doesn''t Survive Reboot - OSOL-124
Rodney, I added a second swap device to my OSOL 2009.06 laptop and my system running Nevada build 124. I can''t reproduce this. Both swap devices appear after reboot. I would agree with Darren''s comments that copies=2 is a better configuration for a one-disk pool. The fact that you can attach a p* partition to storage pool slice is a bug, 6884447. If something happened to your primary root pool slice, we''re not sure that you could boot from the p2 device. In general, we mirror a disk slice (c8t0d0s0) to a disk slice (c9t0d0s0) on ZFS root pools and a disk (c8t0d0) to a disk (c9t0d0) on non-root pools. Mirroring your root pool slice to a p2 partition is untested. Cindy On 10/15/09 05:51, Darren J Moffat wrote:> Rodney wrote: >> Thanks Cindy and Darren. >> >> I installed from the 2009.06 LiveCD and updated via the /dev repo to >> build 124 (and each in between over time). >> >> After a reboot zfs volinit runs. After that I can add the zfs swap >> manually. >> >> What''s the next step to make it run at boot? > > Update /etc/vfstab with a like something like this: > > /dev/zvol/dsk/rpool/swap - - swap - no - > > replacing rpool/swap with what ever your dataset for swap is. > >> And if it''s gone in future builds that what replaces it? > > The work that the *private* ''zfs volinit'' step did is all now automatic > and done in the kernel. Massive boot time improvements for system with > very large numbers of ZVOLs. > >> Regarding mirroring to a slice on the same disk it''s because I''m using >> a laptop with 1 hard disk. >> I created two primary partitions using 50% each. I installed OSOL on >> the first and mirrored to the 2nd primary partition. I''m using >> compression. I thought this was a good way to get redundancy while >> also gaining back a lot of the lost space. > > I''ve tried that in the past (about 3 years a go IIRC) and it just hurts > performance. Since you can''t physically replace either side of the > mirror you will get the same level of protection (maybe even better) and > better performance by setting the property copies to 2 (eg ''zfs set > copies=2 rpool''). >