Add or change swap partition

SOLARIS: Add a SWAP partition

https://sites.google.com/site/syscookbook/solaris/solaris-swap-add

# Tested on Solaris 10 x86 32bit

# Display configured swap:

swap -l
No swap devices configured

# Configure a disk partition to add to swap

format
[…]

partition> p
Current partition table (original):
Total disk cylinders available: 19454 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
0       root    wm       3 –   525        4.01GB    (523/0/0)     8401995
     1 unassigned    wm     526 –  1178        5.00GB    (653/0/0)    10490445   <—-
2     backup    wm       0 – 19453      149.03GB    (19454/0/0) 312528510
3        var    wm    1179 –  1440        2.01GB    (262/0/0)     4209030
4 unassigned    wm    1441 –  1702        2.01GB    (262/0/0)     4209030
5       home    wm    1703 –  1964        2.01GB    (262/0/0)     4209030
6        usr    wm    1965 –  2617        5.00GB    (653/0/0)    10490445
7 unassigned    wm       0                0         (0/0/0)             0
8       boot    wu       0 –     0        7.84MB    (1/0/0)         16065
9 alternates    wu       1 –     2       15.69MB    (2/0/0)         32130

partition> 1
Part      Tag    Flag     Cylinders         Size            Blocks
1 unassigned    wm     526 –  1178        5.00GB    (653/0/0)    10490445

Enter partition id tag[unassigned]: swap
Enter partition permission flags[wm]:
Enter new starting cyl[526]:
Enter partition size[10490445b, 653c, 1178e, 5122.29mb, 5.00gb]:
partition> label
Ready to label disk, continue? y

[…]

# Add the partition as swap space (if no dump device is configured we receive
#                                   message indicating it is being done)

swap -a /dev/dsk/c0d1s1
operating system crash dump was previously disabled —
invoking dumpadm(1M) -d swap to select new dump device

# Check

swap -l
swapfile             dev  swaplo blocks   free
/dev/dsk/c0d1s1     102,65      8 4194288 4194288

# Add following line to vsftab

/dev/dsk/c0d1s1 – – swap – no –

# Check dump device (1/2)

cat /etc/dumpadm.conf
#
# dumpadm.conf
#
# Configuration parameters for system crash dump.
# Do NOT edit this file by hand — use dumpadm(1m) instead.
#
DUMPADM_DEVICE=/dev/dsk/c0d1s1
DUMPADM_SAVDIR=/var/crash/server
DUMPADM_CONTENT=kernel
DUMPADM_ENABLE=yes
DUMPADM_CSAVE=on

# Check dump device (2/2)

dumpadm
Dump content: kernel pages
Dump device: /dev/dsk/c0d1s1 (swap)
Savecore directory: /var/crash/server
Savecore enabled: yes
Save compressed: on