31 Mayıs 2012 Perşembe

Unix komutları -2


Memory and Swap commands


Solaris
Red Hat
Ubuntu/Debian
HP
AIX
Memory
/usr/platform/`uname -i`/sbin/prtdiag -v
prtconf | grep -i mem
cat /proc/meminfo (detailed)
free -om
cat /proc/meminfo (detailed)
free -om
dmesg | grep -i physical
/usr/sam/lbin/getmem
/opt/ignite/bin/print_manifest
cat /var/opt/ignite/local/manifest/manifest.info
prtconf -m 
prtconf |grep -i memory
lsattr -El sys0 -a realmem
bootinfo -r
page size (memory)
/usr/bin/pagesize
/usr/bin/getconf -a| egrep -i 'pagesize|page_size'
/usr/bin/getconf -a| egrep -i 'pagesize|page_size'
dmesg |grep -i physical
pagesize
pagesize -a (display all supported pagesizes)
display swap
swap -l
swap -s
cat /proc/swaps (detailed)
swapon -s
cat /proc/swaps (detailed)
swapon -s
swapinfo (displayed in KB)
swapinfo -m (display in Mb)
swapinfo -tm (total / Mb)
lsps -a (detailed) 
lsps -s
adding swap
mkfile 5m /var/swapfile 
swap -a /var/swapfile
 

update /etc/vfstab
device:
create partition with fdisk (type 82)
file(create 50MB swap file):
dd if=/dev/zero of=/var/swapfile bs=1024 count=50000

mkswap <device>|<file>
swapon <device>|<file>

update /etc/fstab
device:
create partition with fdisk (type 82)
file(create 50MB swap file):
dd if=/dev/zero of=/var/swapfile bs=1024 count=50000

mkswap <device>|<file>
swapon <device>|<file>

update /etc/fstab
Create logical volume or filesystem

swapon <device> | -f <logical device>
swapon -p 3 <device> | -f <logical device>

update /etc/fstab

Note: -p = priority swap number . The
 nswapdevtunable system parameter controls the maximum number of swap devices.
mkps -a -s 4 -n <volume group>

# change the attributes
 
chps -a n paging00 (don't use after restart)

# change the logical volume attributes (name in this case)
chlv -n <new name> <old old> (chang page space name)
 

Note:

-a reconfigure paging space after restart
-s size of the page space (logical partitions)
-n activiates the paging space (use swapoff to deactivate)

also see /etc/swapspaces file
removing swap
update /etc/vfstab
swap -d
swapoff <device>|<file>

Remove device or file as normal
swapoff <device>|<file>

Remove device or file as normal
remove entry from /etc/fstab
reboot
swapoff /dev/paging00
rmps paging00
 

Note: paging space must be deactiviated before removing

0 yorum:

Yorum Gönder