Archive for the ‘ Ubuntu/Debian ’ Category

Working With LVM In Linux

Creating a new volume group, adding a disk to it and making it usable

Scan HBA for new LUN’s:
#echo ‘- – -‘ > /sys/class/scsi_host/hostX/scan

#fdisk /dev/sda5 (or /dev/mapper/mpathx if multipathing) … create new partition, type lvm (8e), write changes to disk
#partprobe
#pvscan
#pvdisplay
#kpartx -a /dev/mapper/mpathX if it’s a multipathed device using dm-mulipath, otherwise skip this step
#pvcreate /dev/sda5 or /dev/mapper/mpathXpX  (initializes partition for LVM)
#vgcreate vg02 /dev/sda5 or /dev/mapper/mpathXpX (or vgextend vg02 /dev/sda5 or /dev/mapper/mpathXpX to add to a volume group)
#lvcreate -L 500G -n lvora_backup vg02  (or lvextend to add)
#mkfs -V -t ext3 /dev/mapper/vg02-lvora_backup  (or resize2fs to extend the fs)
#mount /dev/mapper/vg02-lvora_backup /ora_backup

edit /etc/fstab:

/dev/vg02/lvora_backup  /ora_backup             ext3    defaults        1 2

Extending a logical volume if the vg has available space

lvextend -L +512M /dev/rootvg/lvtmp
resize2fs /dev/rootvg/lvtmp (If it’s ext3, if not then use your specific filesystem tools)

If it’s GFS2, Find what it’s mounted as using cat /proc/mounts, we’ll look for /home3 in this example:

[root@linuxserver ~]# cat /proc/mounts |grep /home3
/dev/dm-54 /home3 gfs2 rw,noatime,nodiratime,hostdata=jid=0,localflocks,data=writeback 0 0

Next we’ll do a test run to make sure we don’t bugger anything up:

[root@linuxserver ~]# gfs2_grow -T /home3
(Test mode–File system will not be changed)
FS: Mount Point: /home3
FS: Device:      /dev/dm-54
FS: Size:        31457278 (0x1dffffe)
FS: RG size:     65535 (0xffff)
DEV: Size:       51132416 (0x30c3800)
The file system grew by 76856MB.
gfs2_grow complete.

Looks good, let’s run it without the -T flag:

[root@linuxserver ~]# gfs2_grow /home3
FS: Mount Point: /home3
FS: Device:      /dev/dm-54
FS: Size:        31457278 (0x1dffffe)
FS: RG size:     65535 (0xffff)
DEV: Size:       51132416 (0x30c3800)
The file system grew by 76856MB.
gfs2_grow complete.

How to find the scsi id of any device on linux

#scsi_id -g -u -s /block/sdx

If it’s a vm
#cat /proc/scsi/scsi

if it’s a /dev/cciss device(HP SAS) then use

#cciss_id /dev/cciss/cXdX

-bb

Installing The Latest Deluge in Ubuntu 9.10 (Karmic Koala)

Torrent clients on Linux just don’t seem to stack up to uTorrent.  I’ve tried all of them  and deluge seems to be the most configurable and feature rich that I’ve found.  Yes I’ve tried transmission, ktorrent, rtorrent and several others I don’t care to recall.  My primary computer at home is a Linux Mint Helena 64-bit, which is basically just Karmic all gussied up.  Here’s how I installed the latest and greatest version of deluge (1.2.3).  Some of the trackers I use have banned the use of deluge releases prior to 1.2.1.  Deluge 1.1.9 is what is in Karmic’s repo’s by default so this was a problem.  I gleaned these instructions from https://launchpad.net/~deluge-team/+archive/ppa.  Commands are in italics.

Pretty simple really, just open a terminal and type in:

$sudo add-apt-repository ppa:deluge-team/ppa

adds the deluge ppa to your systems software sources

$sudo apt-get update

checks the repo’s for the latest versions of the software

$sudo apt-get install deluge

installs the latest deluge on to your computer (1.2.3 as of this post).

That’s it!  Happy Sharing!

-bb