Showing posts with label storage. Show all posts
Showing posts with label storage. Show all posts

Friday, April 20, 2012

SAN Storage : How To Remove LUN

I did this on SLES11, but i think it can be applied on other distro also.

1. Unmap the LUN from the SAN controller.
2. To list down the current mapped LUN : multipath -ll

360050768028082bde800000000000008 dm-2 IBM,2145
size=70G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=0 status=active
| |- 1:0:0:1 sdc 8:32 failed faulty running
| `- 2:0:0:1 sdg 8:96 failed faulty running
`-+- policy='round-robin 0' prio=0 status=enabled
|- 1:0:1:1 sde 8:64 failed faulty running
`- 2:0:1:1 sdi 8:128 failed faulty running

3. multipath -f (LUN Id)
regdb02:~ # multipath -f 360050768028082bde800000000000008

4. clean up the scsi device record :

regdb02:~ # echo "1" > /sys/class/scsi_device/1\:0\:0\:1/device/delete
regdb02:~ # echo "1" > /sys/class/scsi_device/2\:0\:0\:1/device/delete
regdb02:~ # echo "1" > /sys/class/scsi_device/1\:0\:1\:1/device/delete
regdb02:~ # echo "1" > /sys/class/scsi_device/2\:0\:1\:1/device/delete

5. list down back the mapped LUN :

regdb02:~ # multipath -ll
regdb02:~

* empty already

5. rescan the bus

regdb02:~ # cd /usr/bin/
regdb02:/usr/bin # ./rescan-scsi-bus.sh

Done

Tuesday, May 31, 2011

How To Setup NFS on CentOS

How to setup NFS on CentOS:

1. Server Side :

- kena install nfs,nfs utils,portmap :

# yum install nfs-utils nfs4-acl-tools portmap

- kena allow file ape yg nak share dan ip mane allowed kt /etc/export :

/backup/srv77 192.168.0.3(rw,sync,no_root_squash,fsid=0)

- kena allow portmap kt /etc/hosts.allow :

portmap: 192.168.0.0/255.255.255.0, 10.0.0.0/255.0.0.0
portmap: 192.168.0.4/255.255.255.0

- kena allow ip kt firewall,iptables or csf :

192.168.0.3

- kena set service nfs dan portmap kt initial setup :

chkconfig --level 235 nfs on
chkconfig --level 235 portmap on

- kena start service nfs dan portmap :

/etc/init.d/nfs start
/etc/init.d/portmap start

2. Client side :

- kena install nfs,nfs utils,portmap :

# yum install nfs-utils nfs4-acl-tools portmap

- kena create folder utk mount :

mkdir /mnt/srv4

- kena add kt /etc/fstab :

192.168.0.4:/backup/srv77 /mnt/srv4 nfs rw,hard,intr 0 0

- kena allow ip kt firewall,iptables or csf :

192.168.0.4

- kena set service nfs dan portmap kt initial setup :

chkconfig --level 235 nfs on
chkconfig --level 235 portmap on

- kena start service nfs dan portmap :

/etc/init.d/nfs start
/etc/init.d/portmap start

- kena add usef nfs :

useradd nfs -u 1000

- kena mount nfs to /mnt/srv4 :

mount -t nfs 192.168.0.4:/backup/srv77 /mnt/srv4 atau

mount -t nfs -o rw 192.168.0.4:/backup/srv77 /mnt/srv4

- nak remount nfs

mount -o remount,defaults,ro /mnt/Qbackup

or

mount -o remount,defaults,rw /mnt/Qbackup

instead of

mount -o remount,rw /mnt/Qbackup


COMMAND LAIN :

mount | grep -i '192.168.0.4'

nfsstat