Reducing a root LVM

In this post I want to reduce root volume to free up the space for other volumes. Let’s discuss it step by step:

1. Download Linux system rescue disk such as SYSTEMRESCUECD or KNOPPIX available as a bootable CD-ROM . I prefer systemrescuecd.

Official site for systemrescuecd: http://www.sysresccd.org . Direct download link is this.
Official site for knoppix: http://www.knoppix.net

2.  Boot  SYSTEMRESCUECD on start-up. This step is done because we need volume, that should be shrunk, to be unmounted. As you know root volume cannot be unmounted when the OS is running on it.

3.  Make all LVM volumes found available to the rescue kernel:

root@sysresccd ~ % lvm vgchange -a y

4. List logical volume names:

root@sysresccd ~ % ls /dev/VolGroup00/
LogVol00 LogVol01

5. Before shrinking file system , it is recommended to check file system and fix any errors:

root@sysresccd ~ %  e2fsck -f /dev/VolGroup00/LogVol00

6. After the check is successful, shrink the file system on LVM. I am reducing it to 50G.

root@sysresccd ~ % resize2fs -f /dev/VolGroup00/LogVol00 50G

7.  Re-run e2fsck.

root@sysresccd ~ %  e2fsck -f /dev/VolGroup00/LogVol00

8.  Now reduce the logical volume itself to 50G.

root@sysresccd ~ % lvm lvreduce -L50G /dev/VolGroup00/LogVol00

Note : If you want to reduce size of the volume by some value, you should use minus sign in front of the number value like : –L  -50G.

Reboot the system.

Reset root password in CentOS 5.5

If you don’t know the root password and want to login in to the server, follow these instructions:

Picture 1: Press “e” to edit.

Centos 5.5 VirtualBox Reset root Password

Picture 2: Press “e” to edit.

Centos 5.5 VirtualBox Reset root Password

Picture 3: Type “S” at the end of the line. Press Enter.

Centos 5.5 VirtualBox Reset root Password

Picture 4: After pressing Enter, you will see the following picture. Press “b” to boot.

Centos 5.5 VirtualBox Reset root Password

Picture 5: You will see the following picture…

Centos 5.5 VirtualBox Reset root Password

Type “su –” and you will be a root user.

To make it permanent you should edit it in the following file:

vi /boot/grub/menu.lst
default=0
timeout=5
.
.
.
kernel /vmlinuz-2.6.18-194.el5 ro root=/dev/VolGroup00/LogVol00 S
.
.
.

How to root HTC sensation(Windows Users)

1. Plug in your HTC to PC.

2. Go to the Settings->Applications->Development and check the box for USB debugging in your HTC.

3. Download All installation things from here. and HTC driver from here.

4. Run HTCDriver3.0.0.007.exe, and install it(This is HTC driver installation).

5. You should see the following in Device Manager list:

Android USB Devices Device ManagerPicture 1

6. Copy PG58IMG.zip and paste it in the root folder of sdcard.

7. Turn off HTC-> Pull the battery off-> Put the battery back-> Press Down Volume key,hold it-> Press down the Power button key…

There will appear the following question:

Do you want to start update?

Press volume up key(means yes)

Press power button to reboot.

8. Run CMD, change path to the downloaded file, and run the following(Note HTC should be plugged into the PC, in Charge Only mode):

> adb devices

My output is

List of devices attached
HT15NV815414    device

9. Go to www.Revolutionary.io  Click Download for Windows(revolutionary file will be downloaded).

Fill the form on that site, like that:

Revolutionary utility gain beta keyPicture 2

Click Generate key button. Copy and save you beta key.

HBOOT version can be seen if you turn off HTC, pull the battery off, then pull it back, Press Down Volume key and hold it, then press the power button. You should see the screen like that:

HTC Sensation HBOOT versionPicture 3

 

There is S-OFF because I have already done these steps. You should have S-ON, now.

10. Return to our CMD(You are in the download file) and run revolutionary.exe

It will ask you the beta key. Enter the previously gained key from www.Revolutionary.io site.

The process should start, it will reboot you device several times and you should see S-OFF instead of S-ON on your HTC screen(picture 3).

Type Y value for the question and press ENTER.

11. Delete PG58IMG.zip  from your sdcard. And copy su-2.3.6.3-efgh-signed.zip file into sdcard root directory.

Power off HTC, pull the battery off, then put it back, Press Down Volume key and hold it, then press the power button.

You should see the Picture 3.

Press down volume key and chose RECOVERY, press the power button.

It should show the list.

Choose

-install zip from sdcard

then

-choose zip from sdcard

and choose:

-su-2.3.6.3-efgh-signed.zip

then

-Yes – Install su-2.3.6.3-efgh-signed.zip

It may show that the installation was aborted. Ignore it and repeat the steps from choosing zip file from sdcard.

Then Go Back and choose:

-reboot system now

That is all…