Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

configuring swap 1

Status
Not open for further replies.

misjay01

Technical User
Jun 17, 2003
50
GB
I have not done the norm when formating disk by putting swap on slice 1, only found out after. So now when I do a swap -l I get the no swap devices configued. How can I change this so that the system recognises that I had a swap partition ?

# swap -l
No swap devices configured

Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 5266890 90626 5123596 2% /
/dev/md/dsk/d1 5040814 1149505 3840901 24% /usr
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
/dev/md/dsk/d2 9073334 64695 8917906 1% /var
swap 1686336 40 1686296 1% /var/run
swap 1686296 0 1686296 0% /tmp
/dev/md/dsk/d3 9073334 441881 8540720 5% /export
/dev/md/dsk/d4 4032504 10 3992169 1% /opt
/dev/md/dsk/d5 2407114 9 2358963 1% /swap
 
It looks like you have a /swap filesystem? Swap space is not normally created on a filesystem (although it can be).

umount /swap, edit /etc/vfstab and remove the line referring to it, and then add a new one containing:

[tt]/dev/md/dsk/d5 - - swap - no -[/tt]

Then type swap -a /dev/md/dsk/d5.

You should try a reboot to make sure that the new /etc/vfstab entry works.

Annihilannic.
 
Ok did that, but I'm worried that during startup the file system checks are only showing clean on ufs slices d3 and d4 and not d0-d4 ? Does this mean the d0-d2 are corrupt ?



Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# df -k
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d0 5266890 90706 5123516 2% /
/dev/md/dsk/d1 5040814 1149505 3840901 24% /usr
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
/dev/md/dsk/d2 9073334 65073 8917528 1% /var
swap 4133464 40 4133424 1% /var/run
swap 4133432 8 4133424 1% /tmp
/dev/md/dsk/d3 9073334 441881 8540720 5% /opt
/dev/md/dsk/d4 4032504 10 3992169 1% /export
# swap -l
swapfile dev swaplo blocks free
/dev/md/dsk/d5 85,5 16 4917056 4917056
#


#device device mount FS fsck mount mount
#
fd - /dev/fd fd - no -
/proc - /proc proc - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/md/dsk/d1 /dev/md/rdsk/d1 /usr ufs 1 no -
/dev/md/dsk/d2 /dev/md/rdsk/d2 /var ufs 1 no -
/dev/md/dsk/d3 /dev/md/rdsk/d3 /opt ufs 2 yes -
/dev/md/dsk/d4 /dev/md/rdsk/d4 /export ufs 2 yes -
/dev/md/dsk/d5 - - swap - no -
swap - /tmp tmpfs - yes -
 
If you notice the later columns, "fsck pass" and "mount at boot", they are different for d3-4 and d0-2. d0-2 contain the /, /usr and /var filesystems,
which are required at the very start of the boot process.

/opt and /export are mounted later, and that is when you are seeing those messages. Don't worry that they are not listed as being clean; if they weren't they would have been cleaned earlier in the boot process.

Annihilannic.
 
This look useful. But can you specific the amount of swap file you want. Normally it is 2 times the size of the physical memory.

Do you need to do unmount and do a newfs to recreate dev/md/dsk/d5 as double size of the physical memory ?

cheers
SP
 
You do not need to umount it as it isn't mounted as a filesystem. Use swap -d /dev/md/dsk/d5 to remove it as a swap device.

Likewise you do not need to newfs it because it does not contain a filesystem; it is just used as a raw device. So once you have resized your partitions, etc. you simply reintroduce it as a swap device using swap -a as described above.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top