{"id":1356,"date":"2022-02-05T15:31:43","date_gmt":"2022-02-05T15:31:43","guid":{"rendered":"\/blog\/?p=1356"},"modified":"2022-02-05T15:31:44","modified_gmt":"2022-02-05T15:31:44","slug":"swap-in-solaris-11","status":"publish","type":"post","link":"\/blog\/index.php\/swap-in-solaris-11\/","title":{"rendered":"swap in Solaris 11"},"content":{"rendered":"\n<ul class=\"wp-block-list\"><li>-s\u00a0To view the\u00a0summary\u00a0of the current swap space allocation:# swap -s total: 106256k bytes allocated + 8512k reserved = 114768k used, 587512k available<\/li><li>-l<strong>\u00a0 To\u00a0list details\u00a0of the system\u2019s virtual swap space:<\/strong><br><br># swap -l<br>swapfile dev swaplo blocks free<br>\/dev\/dsk\/c0t0d0s1 136,1 16 1206736 1084736<br>\/export\/data\/swapfile -16 40944 40944<br>\u00a0<\/li><li><code>-d\u00a0<\/code><strong>To\u00a0delete\u00a0a swap slice or swap slice from the current swap configuration.<\/strong># swap -d \/dev\/dsk\/c1t0d0s3<br>\u00a0To prevent the swap slice from being configured as part of the swap configuration during a reboot or change of run level, edit the\u00a0<strong>\/etc\/vfstab\u00a0<\/strong>file, and remove the swap slice entry from the file.Operations on swap file are similar to operation on swap slice:<ul><li>Delete a swap file from the current swap configuration.<br><code># swap -d \/export\/data\/swapfile<br>\u00a0<\/code><\/li><li>Remove the file to free the disk space that it is occupying.# rm \/export\/data\/swapfile<\/li><li>To prevent the swap file from being configured as part of the swap\u00a0 configuration during a reboot or change of run level, edit the\u00a0<strong>\/etc\/vfstab\u00a0<\/strong>file, and remove the swap file entry.<br><br><strong>Note\u00a0<\/strong>\u2013 The output of the\u00a0<strong>df -h \/export\/data\/swapfile\u00a0<\/strong>command shows the space in use until you remove the swap file.<\/li><li><\/li><\/ul><\/li><li>-a\u00a0To\u00a0<strong>add additional swap area<\/strong><ul><li><strong>To add a swap slice\u00a0<\/strong>Edit the<strong>\u00a0\/etc\/vfstab\u00a0<\/strong>file to add information describing the swap slice.\u00a0 # vi \/etc\/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot optAdd the following line to create the swap slice.<kbd>\/dev\/dsk\/c1t0d0s3 --swap -no -<\/kbd>Use the\u00a0<strong>swap -a\u00a0<\/strong>command to add additional swap area.# swap -a \/dev\/dsk\/c1t0d0s3<strong>Note<\/strong>\u00a0\u2013 When the system is subsequently rebooted, the new swap slice\u00a0<strong>\/dev\/dsk\/c1t0d0s3\u00a0<\/strong>will be automatically included as part of the swap space as a result of adding the entry to the\u00a0<strong>\/etc\/vfstab\u00a0<\/strong>file.\u00a0\u00a0<\/li><li><strong>Adding Swap Files.\u00a0<\/strong>Swap files can be used when you need to add swap space and do not have a free partition to use.\u00a0To add a swap file, complete the following steps:<ol><li>Create a 1G swap file named swapfile in the partition that have enough free space, for example\u00a0<code>\/export\/data<\/code>\u00a0directory.# mkfile 1000m \/export\/data\/swapfile<\/li><li>Add the swap file to the system\u2019s swap space.# swap -a \/export\/data\/swapfile<\/li><li>List the details of the modified system swap space with\u00a0swap -l<\/li><li>List a summary of the modified system swap space with\u00a0swap -s<\/li><li>To use a swap file when the system is subsequently rebooted,\u00a0<strong>add an entry for the swap file in the<\/strong>\u00a0\/etc\/vfstab\u00a0<strong>file.<\/strong># vi \/etc\/vfstab<br>#device device mount FS fsck mount mount<br>#to mount to fsck point type pass at boot opt<br>\/export\/data\/swapfile &#8211;swap -no &#8211;<\/li><\/ol><\/li><\/ul><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>-s\u00a0To view the\u00a0summary\u00a0of the current swap space allocation:# swap -s total: 106256k bytes allocated + 8512k reserved = 114768k used, 587512k available -l\u00a0 To\u00a0list details\u00a0of the system\u2019s virtual swap space: # swap -lswapfile dev swaplo blocks free\/dev\/dsk\/c0t0d0s1 136,1 16 1206736 1084736\/export\/data\/swapfile -16 40944 40944\u00a0 -d\u00a0To\u00a0delete\u00a0a swap slice or swap slice from the current swap configuration.# [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1356","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1356"}],"version-history":[{"count":1,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1356\/revisions"}],"predecessor-version":[{"id":1359,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1356\/revisions\/1359"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1356"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}