Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 467
  • Last Modified:

How to set the swap and dump device using zfs ?

I created a pool using zpool, now i would like to give some dedicated space to swap and dumpadm device. How to proceed to create and configure dumpdevice and swap using zfs ?
0
beer9
Asked:
beer9
  • 2
  • 2
1 Solution
 
Brian UtterbackPrinciple Software EngineerCommented:
What OS rev are you using? Are you running with a root pool, rpool? If so, then you probably already have swap
and dump on the rpool. If you are using Solaris 10 and do not have a root pool, then you need to create two
zvols in your pool, one for swap and one for dump.

This is really simple, but it is slightly different on sparc vs. x86. For x86, run this command:

zfs create -V 2G -b 4k poolname/swap

on sparc use this:

zfs create -V 2G -b 8k poolname/swap

For the dump device, run this command on either arch:

zfs create -V 2G -b 128k poolname/dump

All of the above commands create zvols that are 2GB in size. You should adjust the size as you require. One
cool thing about zvols, is that you can resize them later.

Once the zvols are done, just modify the /etc/vfstab file to point the swap entry to the newly created swap zvol.
The device name for this zvol is /dev/zvol/dsk/poolname/swap.

Then use the dumpadm command to set the dump device to /dev/zvol/dsk/poolname/dump.

One thing to be careful of, if you have a crash, you will need to run savecore manually. There is a bug that
prevents savecore from running automatically with a zvol as the dump device.

0
 
beer9Author Commented:
Thanks for the detailed explanation blu, could you please let me know why we are giving specific block like 4k and 8k? and 128k for dump device.. Thanks!
0
 
Brian UtterbackPrinciple Software EngineerCommented:
For the swap, the correct blocksize is required. I am not so sure about the dumpdevice, but that is the blocksize
in the examples I found.
0
 
beer9Author Commented:
Thanks blu :-)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now