Posts Tagged ‘Linux’

Debian :: Accessing lvm from single user mode

November 9, 2012

We have /usr mounted on lvm,  so it’s tricky to get the commands in
/usr/bin and /usr/sbin to work in single user mode. lvm devices wont
be loded by default.

lvm vgscan
lvm vgchange -ay
lvm lvs

Now you should see your normal LVM devices in /dev (example:
/dev/LVM-GROUP/LVM-VOLUME) . You can mount and use them.

Change Hostname Permanently on Debian or Ubuntu

February 10, 2008

Debian based systems use the file /etc/hostname to read the hostname of the computer at boot time and set it up using the init script /etc/init.d/hostname.sh

We can edit the file /etc/hostname and change the hostname and then run:

/etc/init.d/hostname.sh start

Steps:

1. sudo gedit /etc/hostname
2. Save the file with the hostname you like to set
3. sudo /etc/init.d/hostname.sh start

Ref: http://sysblogd.com/50/change-hostname-permanently-on-debian-or-ubuntu.htm

Unmounting virtfs mounts ::: cPanel

February 5, 2008

First of all, check if the user is running any jailshell process is running

ps aufx |grep user |grep jailshell

Kill’em

Unmount the mounts created by that user:
for i in `cat /proc/mounts |grep virtfs |grep user_name_here |awk ‘{print$2}’`; do umount $i; done

Encrypt a file from command line using gpg

January 22, 2008

To encrypt a file

$gpg -c filename

To Decrypt file

$gpg file.gpg