Archive for the ‘How-tos’ Category

How to: mount Logical Volume Drive as External Device to Linux File System

Friday, October 16th, 2009

First of all, we have to check if this hard disk is recognized by the system:

root@localhost ~]# fdisk -l

Let’s say your drive is assigned /dev/sdc. Then we scan for logical volumes so you’ll see something like this:

Disk /dev/sdc: 20.0 GB, 20020396032 bytes
255 heads, 63 sectors/track, 2434 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          13      104391   83  Linux
/dev/sdc2              14        1670    13309852+   f  W95 Ext’d (LBA)
/dev/sdc3            1671        2434     6136830   8e  Linux LVM
/dev/sdc5              14          75      497983+  82  Linux swap / Solaris
/dev/sdc6              76        1670    12811806   83  Linux

Next we scan for physical volumes:

root@localhost ~]# pvscan

You’ll get:

PV /dev/sdc3   VG VolGroup00   lvm2 [5.84 GB / 32.00 MB free]
Total: 1 [5.84 GB] / in use: 1 [5.84 GB] / in no VG: 0 [0   ]

Then scan for logical volumes:

root@localhost ~]# lvscan

You’ll get:

inactive            ‘/dev/VolGroup00/LogVol00′ [5.31 GB] inherit
inactive          ‘/dev/VolGroup00/LogVol01′ [512.00 MB] inherit

Logical volume that we want to access must be active, therefore we type in:

root@localhost ~]# /usr/sbin/lvchange -a y /dev/VolGroup00/LogVol00

Then mount to file system:

root@localhost ~]# mount -t ext3 /dev/VolGroup00/LogVol00 /mnt/

When done, unmount and revert to inactive mode:

root@localhost ~]# /usr/sbin/lvchange -a n /dev/VolGroup00/LogVol00

How to: show hidden all files including hidden ones in Linux command line

Tuesday, October 13th, 2009

I did this in openSUSE.

It’s as simple as:

root@localhost ~]# ls -a

better yet, use alias if you want to include attributes:

root@localhost ~]# ll

far better with attributes:

root@localhost ~]# l

How cool is that? I didn’t create an alias for it. I accidentally hit hard return after pressing ‘l’. Nice huh.

How to: to system update on openSUSE via console

Tuesday, September 22nd, 2009

I’m beginning to study OpenSuse openSUSE and I would like to commit myself on learning more about it.

Once in a while I’ll insert ‘How-to’ in this blog. With this, let me begin with yast2.

To do system update using command line, type in:

yast2 –update

How to: Install Nagios on OpenSuse 11.1

Wednesday, July 29th, 2009

I’ve been wanting to use Nagios for monitoring services that run in the network.

What services are these?

These are http, https httpd among others.

That’s why I installed Nagios first on a linux box running on Centos 5.3. Unfortunately, I had to reformat that box for something else.

So when I finally had a machine that can handle my needs for multiple virtual machines, I started playing around with more distributions.

One of them is OpenSuse 11.1.

And now, how to install Nagios eh?

Run terminal
type in:
zypper install nagios nagios-www

That’s all!

All you need to do is to check if apache is already installed. If not:
zypper install apache2

Then start nagios:
rcnagios start && insserv nagios

and start apache:
rcapache2 start

lastly, to access nagios via browser, we have to add user and password by:
htpasswd2 -c /etc/nagios/htpasswd.users nagiosadmin

You should be able to navigate nagios via http://yourhost/nagios

nagios

How To: Mount Samba Shares via commandline

Wednesday, July 1st, 2009

To manually mount, in commandline type:
root@locahost ~]# mount -t cifs //servername/sambashare /mount/point -o username=aby,password=aby

To mount during bootup, edit file system table:
root@localhost ~]# vi /etc/fstab

and insert:
//servername/sambashare /mount/point cifs user=aby,pass=aby defaults rw 0 0