Search This Blog

Showing posts with label SUN Server. Show all posts
Showing posts with label SUN Server. Show all posts

Tuesday, December 25, 2012

How to resize or shrink the partition (LVM) in linux or VM

I wanted to shrink LVM partition in VM which has redhat linux and expand root partition because of  memory issue on root partition.  I have done searching excercise in the web and below are the results of the search and best pages that I have seen. However I was not able to reduce the LVM partition as all the procedures mentioned in the below did not recognize the LVM partition created in the redhat linux VM installation. Below procedures are pretty good in general and but does not work for LVM on VM. gparted, parted or steps mentioned below may work other partions. You can try got LVM, it may work for you. I have kept consolidated search result in one page.

http://gparted.sourceforge.net/download.php

http://www.thegeekstuff.com/2011/09/parted-command-examples/
http://gparted.sourceforge.net/screenshots.php#gparted-live-boot-menu
http://en.kioskea.net/faq/2036-how-to-resize-a-partition-using-gparted-on-linux

Back up all your important data before attempting this. Always assume that you can lose all your data when resizing partitions.

Shrink LVM without dataloss

This forum thread suggests the following procedure, in this example we shrink a partition from 10G to 9G:
First, we unmount.
# umount /dev/vg_blah/lv_blah
Check the file system.
# e2fsck -f /dev/vg_blah/lv_blah
Resize the file system.
# resize2fs /dev/vg_blah/lv_blah 9G
Reduce the size of the logical volume.
# lvreduce -L -1G /dev/vg_blah/lv_blah
Shrink the volume group if desired.
# vgreduce vg_blah /dev/sdxy

Friday, February 4, 2011

How to set automatic recovery after power failure for a SUN Netra box using ALOM port command

Please refer the How to connect to ALOM port section in this website. Once you login to SUN box and able to see the ALOM prompt sc>, you can use setsc command.
sc> showsc
Check the value for sc_powerstatememory variable. It shall show as below:
sc_powerstatememory false
To set the automatic recovery after power failure, do as below
sc> setsc sc_powerstatememory true
For any other commands use showsc and below syntax
sc> setsc <variable> <Value>

How to connect to console and ALOM port of SUN server

Pick up a laptop and cable which has RJ-47 in one end and 7-Pin serial port on the other end.

Connect RJ-47 to SERIAL MGT port in the Sun Box and serial port to your laptop. Make sure that you have a application like putty for the serial connection. Serial connection configuration shall be 9600/8n1/none. Establish a serial connection using putty, either console login prompt will appear or ALOM port login prompt appears. Please provide login and password, takes you to ALOM prompt or console window. If you wish to go to ALOM prompt from console then type “#.”(HASH and DOT). If you wish to switch to console prompt from ALOM then type “console”.