if you want to increase

3
8/6/2019 If You Want to Increase http://slidepdf.com/reader/full/if-you-want-to-increase 1/3 If you want to increase /var with 400MB, the command would be umount /var e2fsck -fy /dev/vg_system/lv_var lvextend --size +400M /dev/vg_system/lv_var resize2fs /dev/vg_system/lv_var mount /var This partition is resized similarly to /skole/tjener/home0. A reasonable size for this partition would be 32MB times the number of thin clients you  plan to have. If you try to boot more thin clients with swapfiles than you have space for in /var/opt/ltsp/swapfiles, then the thin client will not boot. These swapfiles will be placed in /var/opt/ltsp/swapfiles, with the file names 192.168.0.10.swap, 192.168.0.11.swap,192.168.0.12.swap. If you delete these swapfiles, they will be created again next time the thin client boots. If you want to increase /var/opt/ltsp/swapfiles with 600MB, the command would  be umount /var/opt/ltsp/swapfiles e2fsck -fy /dev/vg_system/lv_ltsp_swap lvextend --size +600M /dev/vg_system/lv_ltsp_swap resize2fs /dev/vg_system/lv_ltsp_swap mount /var/opt/ltsp/swapfiles If there is already thinclients running using such a swapfile, you might have to stop nfs  before you manage to umount /var/opt/ltsp/swapfiles /etc/init.d/nfs-common stop /etc/init.d/nfs-kernel-server stop And then when you are done resize, start nfs again /etc/init.d/nfs-kernel-server start /etc/init.d/nfs-common start 8.5.6. Swap This lv belongs to vg_system. It's present in the profiles mainserver, workstation and thinclientserver. Resize the swap-partition is a bit different than the other partitions, mainly because there is no ext2 filesystem on this partition.

Upload: paragbaruah

Post on 07-Apr-2018

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: If You Want to Increase

8/6/2019 If You Want to Increase

http://slidepdf.com/reader/full/if-you-want-to-increase 1/3

If you want to increase /var with 400MB, the command would be

umount /var e2fsck -fy /dev/vg_system/lv_var lvextend --size +400M /dev/vg_system/lv_var 

resize2fs /dev/vg_system/lv_var mount /var 

This partition is resized similarly to /skole/tjener/home0.

A reasonable size for this partition would be 32MB times the number of thin clients you plan to have. If you try to boot more thin clients with swapfiles than you have space for 

in /var/opt/ltsp/swapfiles, then the thin client will not boot.

These swapfiles will be placed in /var/opt/ltsp/swapfiles, with the file names

192.168.0.10.swap, 192.168.0.11.swap,192.168.0.12.swap. If you delete these

swapfiles, they will be created again next time the thin client boots.

If you want to increase /var/opt/ltsp/swapfiles with 600MB, the command would

 be

umount /var/opt/ltsp/swapfiles 

e2fsck -fy /dev/vg_system/lv_ltsp_swap lvextend --size +600M /dev/vg_system/lv_ltsp_swap resize2fs /dev/vg_system/lv_ltsp_swap 

mount /var/opt/ltsp/swapfiles 

If there is already thinclients running using such a swapfile, you might have to stop nfs before you manage to umount /var/opt/ltsp/swapfiles 

/etc/init.d/nfs-common stop /etc/init.d/nfs-kernel-server stop 

And then when you are done resize, start nfs again

/etc/init.d/nfs-kernel-server start

/etc/init.d/nfs-common start 

8.5.6. Swap

This lv belongs to vg_system. It's present in the profiles mainserver , workstation and

thinclientserver .

Resize the swap-partition is a bit different than the other partitions, mainly because thereis no ext2 filesystem on this partition.

Page 2: If You Want to Increase

8/6/2019 If You Want to Increase

http://slidepdf.com/reader/full/if-you-want-to-increase 2/3

First use free to see the current size of swap

ltspserver05:~# freetotal used free shared buffers

cachedMem: 256968 96684 160284 0 5536

48500-/+ buffers/cache: 42648 214320Swap: 524280 0 524280

Then turn swap off with the command swapoff 

ltspserver05:~# swapoff /dev/vg_system/lv_swap

Then resize the swap-partition, as usual

ltspserver05:~# lvextend --size +200M /dev/vg_system/lv_swapExtending logical volume lv_swap to 712,00 MB

Logical volume lv_swap successfully resized

Then make new swap with the mkswap

ltspserver05:~# mkswap /dev/vg_system/lv_swapSetting up swapspace version 1, size = 746582 kBno label, UUID=fd634991-e5ca-4aac-9fe8-a000bde6bc38

Then turn on swap again with the command swapon

ltspserver05:~# swapon /dev/vg_system/lv_swap

Then check if you now have a different swapsize

ltspserver05:~# freetotal used free shared buffers

cachedMem: 256968 97036 159932 0 576848520-/+ buffers/cache: 42748 214220Swap: 729080 0 729080

As you can see, 200MB more swap.

Probably the most interesting would be to make the swap-partition smaller, for that usethe same commands as above, but use lvresize -L -300M /dev/vg_system/lv_swap to

reduce the size by 300MB

ltspserver05:~# swapoff /dev/vg_system/lv_swapltspserver05:~# lvreduce --size -300M /dev/vg_system/lv_swapWARNING: Reducing active logical volume to 412,00 MBTHIS MAY DESTROY YOUR DATA (filesystem etc.)

Do you really want to reduce lv_swap? [y/n]: y

Page 3: If You Want to Increase

8/6/2019 If You Want to Increase

http://slidepdf.com/reader/full/if-you-want-to-increase 3/3

Reducing logical volume lv_swap to 412,00 MBLogical volume lv_swap successfully resized

ltspserver05:~# mkswap /dev/vg_system/lv_swapSetting up swapspace version 1, size = 432009 kBno label, UUID=9db01ef6-7623-4e5b-956e-b6fe607aec4fltspserver05:~# swapon /dev/vg_system/lv_swapltspserver05:~# free

total used free shared bufferscachedMem: 256968 97576 159392 0 645648544-/+ buffers/cache: 42576 214392Swap: 421880 0 421880

8.5.7. Resizing /var/spool/squid

This lv belongs to vg_system and it's only present in the profile mainserver . This partition

hold the cache belonging to squid, which is a FTP, HTTP and HTTPS proxy cache. This partition is changed the same way as swapfiles. Make sure you stop squid before you try

to resize,

/etc/init.d/squid stop 

otherwise you only end up withumount: /var/spool/squid: device is busy

The maximum size of this cache is default set to 100MB; look in the file/etc/squid/squid.conf for the line number 699

# cache_dir ufs /var/spool/squid 100 16 256

If you need a bigger squid-cache, remove the # in front of the line, and change the 100 todesired size. Then you must stop squid, resize the squid-cache and finally start squid

again. If you need 500MB for your squid-cache, this line will do that:

cache_dir ufs /var/spool/squid 500 32 256

/etc/init.d/squid stop squid -z /etc/init.d/squid start