Chapter 13. Miscellaneous tasks 223
y
...
7. Start an SSH session as root and view the memory in the /sys/ file system. Change the
directory to /sys/devices/system/memory/ and list the files:
# cd /sys/devices/system/memory
# ls
block_size_bytes memory0 memory1 memory2 memory3
8. Enter the block_size_bytes file by using the cat command:
# cat block_size_bytes
10000000
This number is the number of bytes in hexadecimal. 10000000 in hex is 256 MB in
decimal. So the block size is 256 MB and there are four blocks, memory0 through
memory3, which are represented as directories. Each of the memory blocks has a state,
which is represented as a file.
9. Show the state of each memory block with the following command:
# cat memory*/state
online
offline
offline
offline
The output shows that the first 256 MB is online and the next three blocks are offline.
10.You can also show information about memory by using the free -m command:
# free -m
total used free shared buffers cached
Mem: 241 165 75 0 18 54
-/+ buffers/cache: 92 148
Swap: 761 0 761
This shows 241 MB
11.You can turn on memory by sending the online string to the state file. Turn on an
additional 512 MB of memory by using the following commands:
# echo online > memory1/state
# echo online > memory2/state
12.Show that the memory is now online:
# cat memory*/state
online
online
online
offline
13.Again, confirm the memory by using the free -m command:
# free -m
total used free shared buffers cached
Mem: 753 170 582 0 18 54
-/+ buffers/cache: 98 654
Swap: 761 0 761
14.You can also give the memory back by echoing offline to the state file:
# echo offline > memory1/state
# echo offline > memory2/state
Commenti su questo manuale