Openfiler, LVM and stuff

"Openfiler is the shit"

<< Back to KBIN STUFF

Copyright C.Bingel 2008

 Last update 2009-11-03

Openfiler is a free NAS/SAN appliance based on open source products (Linux/LVM/Samba/OpenLDAP etc). Here is how to do a couple of things through the terminal that can't be done using the WebUI (yet).

Remove Physical Block Device from Volume Group

Note, as always, be sure to have backed up your data in case something goes wrong.

First, we need raid1 capability (I assume pvmove uses that for the data move, it's requires however) :
[root@ocean ~]# modprobe dm-mirror
 Then initate the move of data away from the old disk we're about to remove (in my example here, the disk was not used):
[root@ocean ~]# pvmove /dev/sdf1
  No data to move for vg0
 When this is done, we can remove the disk from the volume group:
[root@ocean ~]# vgreduce vg0 /dev/sdf1
  Removed "/dev/sdf1" from volume group "vg0"

Make list of hard drive serial numbers 

This is especially good to have when you need to replace failed RAID member. The thing is that Openfiler will only tell you which device is malfunctioning (e.g. /dev/sdk), and then it's up to you to figure out which disk that is. If you have 12 disks on several different controller cards, that is not all trivial.

It requires that the HDDs have SMART capability, which all modern IDE/SATA drives have. SCSI i don't know, might work there too?

[root@ocean ~]# for DEV in /dev/sd? ; do echo "**** $DEV ****" ; smartctl -i $DEV | egrep "(Model|Number)" ; echo ; done

**** /dev/sda ****
Device Model:     Maxtor 7B300S0

Serial Number:    B616XKEH

**** /dev/sdb ****
Device Model:     WDC WD10EADS-00P8B0
Serial Number:    WD-WMAVU0025238

**** /dev/sdc ****
Device Model:     WDC WD10EADS-00P8B0
Serial Number:    WD-WMAVU0060794