MAL - Memória Auxiliar do Lutieri

segunda-feira, setembro 19, 2011

LUN Scanning on linux

COPIED FROM
http://support.dell.com/support/edocs/stor-sys/124t/en/124tvs16/install.html#enabling_lun_linux

References:
http://tldp.org/HOWTO/SCSI-2.4-HOWTO/mlproc.html


To verify the detection of a tape drive, administrators should check for its entry in /proc/scsi/scsi. Current versions of Linux may not scan the logical storage unit (LUN) ID of every device. This can result in some PowerVault devices not being identified or listed in the /proc/scsi/scsi output. Administrators can follow these steps to enable support for such devices.
  1. Type cat/proc/scsi/scsi. The output will look similar to the following:
    Attached devices:
    Host: scsi3 Channel: 00 Id: 00 Lun: 00
       Vendor:   Quantum Model: DLT VS160   Rev: 3100
       Type:     Sequential-Access           ANSI SCSI revision: 03
  2. Identify the host adapter, channel number, target ID number, and LUN number for the first LUN of the device to be configured. In this example, the Certance Ultrium 2 (a drive in the PowerVault 124T) is shown at the address, or nexus, 3 0 0 0 — which means host adapter 3, channel number 0, ID 0, and LUN 0. The PowerVault 124T always has the tape drive at LUN 0 and the robot at LUN 1.
  3. For each LUN that needs to be discovered by Linux, issue the following command: echo "scsi add-single-device H C I L">/proc/scsi/scsi
    H C I L refers to the nexus described in step 2. So, with the PowerVault 124T robot configured at LUN 1, type:
    echo "scsi add-single-device 3 0 0 1">/proc/scsi/scsi The echo command will force a scan of each device at the given nexus.
  4. Type cat /proc/scsi/scsi again to verify that all devices are now listed. The output will look similar to the following:
    Attached devices:
    Host: scsi3 Channel: 00 Id: 00 Lun: 00
       Vendor:   Quantum Model: DLT VS160   Rev: 3100
       Type:     Sequential-Access           ANSI SCSI revision: 03 Attached devices:
    Host: scsi3 Channel: 00 Id: 00 Lun: 01
       Vendor:   DELL Model: PV-124T   Rev: V31
       Type:     Sequential-Access           ANSI SCSI revision: 03
    Administrators should add the echo command to the Linux boot scripts because the device information is not persistent and must be created each time the system boots up. One example file that can be used for storing the commands is /etc/rc.local. Note that configuring additional devices on a server or a storage area network (SAN) can cause the devices to be reordered, which requires administrators to modify the commands. If the Fibre Channel adapter supports Persistent Bindings or an equivalent function, it can be enabled to reduce the chance of devices being reordered upon discovery.
NOTE: This procedure must be run each time the server is booted. Also, if backup application services are running (for example, they automatically start when the OS loads), they must be disabled and re-enabled after the above procedure.
The other way to enable LUN support is to recompile the kernel and enable LUN scanning in the Adaptec driver, but it requires advanced knowledge of Linux and will not be covered here. However, it will allow the server to always boot and see the device without any manual procedures.


This procedure also applies when a new Volume (LUN) is created in a storage system and is correctly mapped to the host. In this case is necessary to ReScan the target to update the LUNs in the OS.

In the former case partprobe can be issued to update the partition table.




 keywords: medium changer, linux, 124, TL2000, TL4000, tape device

domingo, setembro 11, 2011

mounting RAID devices on boot

if you already have a software RAID configured with mdadm it won't reassemble automatically on each boot. in order to have it reassembling do the following:

mdadm --detail --scan > /etc/mdadm.conf 

That's pretty much it!

Other useful commands:


Creating a RAID:


mdadm -Cv /dev/md1 -level=1 -n2 /dev/sdb1 /dev/sdc1



watching the building/rebuild status

cat /proc/mdstat

Check the RAID state:

mdadm -D /dev/md1


Simulates a failed drive:

mdadm /dev/md1 -f /dev/sdc1


Add a new drive (partition) to replaced the failed one:

mdadm --manage /dev/md1 -a /dev/sdb2


To reuse the failed drive one have to remove it and add it again to the array:

mdadm --manage /dev/md1 -r /dev/sdc1
mdadm --manage /dev/dm1 -a /dev/sdc1

Stopping a RAID:

mdadm -S /dev/md1



To "remount" a stopped or un-assembled RAID:

mdadm --assemble /dev/md1 /dev/sdb1 /dev/sdc1

OR

mdadm --assemble --scan


one more time the gentoo wiki has thousands of good info regarding software-based RAID:
http://en.gentoo-wiki.com/wiki/RAID/Software

Marcadores:



Chat with Lutieri G. B.

Subscribe in a reader