How to clean a LUN
RHEV 3.0 and earlier requires a clan LUN to create a new storage domain. This is done intentionally so you do not overwrite existing data. However if you want to force RHEV to use a LUN with existing data you can wipe out the first 512 bytes of the lun to fool RHEV in to thinking the LUN is empty.
basically there are two steps………
1. Find the path to the LUN
Run the command “multipath -ll” on a host to see whether it “sees” the SAN luns or not, the output will look something like this if it “sees” the LUN:
mpath1 (3600d0230003228bc000339414edb8101) [size=100 GB][features=”0″][hwhandler=”0″]
\_ round-robin 0 [prio=1][active]
\_ 2:0:0:6 sdb 8:16 [active][ready]
\_ round-robin 0 [prio=1][enabled]
\_ 3:0:0:6 sdc 8:64 [active][ready]
If you do not see the LUN in the multipath output it means that the host can not access the LUN, ie its not presented correctly to the host. Check you SAN ACLS. If you are using ISCSI make sure you are logged in. see my post on ISCSI notes for more info.
2. “Clean” the LUN. The LUN must be empty to add to the RHEV-M. You can use “dd” to wipe out the first 512 bytes of the lun to fool RHEV in to thinking the LUN is empty.
dd if=/dev/zero of=/dev/path/to/LUN bs=1024k count=10
Leave a Reply