RAID
HowTo: Recover RAID volume and mount seperatly
My NAS storage was crashed, this time I was forced to move one of the raid volume to another server to make the service up because the volume contains all VM’s used by XEN server, most probably it is a LVM disk.
Everybody knows that we can’t simply attach the raid disk to another machine, so just follow the procedures below.
Once I attached the HDD to another machine. check the disk availability
root@ubuntu:~# mdadm --examine /dev/sdb
/dev/sdb: Magic : a92b4efc Version : 1.2 Feature Map : 0x0 Array UUID : ec2c6fb2:f211cfa5:8dfa8777:4f08bfed Name : openmediavault:storage Creation Time : Fri May 9 16:22:45 2014 Raid Level : raid1 Raid Devices : 2 Avail Dev Size : 1953523120 (931.51 GiB 1000.20 GB) Array Size : 976761424 (931.51 GiB 1000.20 GB) Used Dev Size : 1953522848 (931.51 GiB 1000.20 GB) Data Offset : 2048 sectors Super Offset : 8 sectors State : clean Device UUID : 3a9e90a0:ca0e458e:c48e1b34:f3aaf06f Update Time : Tue Jun 24 16:20:00 2014 Checksum : eaa54b02 - correct Events : 24468 Device Role : Active device 1 Array State : .A ('A' == active, '.' == missing)
It sounds good now move to the next step, It should be create the block device md* so it will be reveal the partitions.
root@ubuntu:~# mdadm --assemble --force /dev/md127 /dev/sdb
You will get the output like this
root@ubuntu:~# ll /dev/md127 brw-rw---- 1 root disk 9, 127 Jun 24 14:27 /dev/md127
Now you can see the LVM names
root@ubuntu:~# lvs LV VG Attr LSize Origin Snap% Move Log Copy% Convert nfs storage -wi-ao 931.51g root@ubuntu:~# pvs PV VG Fmt Attr PSize PFree /dev/md127 storage lvm2 a- 931.51g 0 root@ubuntu:~# vgs VG #PV #LV #SN Attr VSize VFree storage 1 1 0 wz--n- 931.51g 0
Mount the partition manually
root@ubuntu:~# mount /dev/mapper/storage-nfs /export/
root@ubuntu:~# mount | grep nfs /dev/mapper/storage-nfs on /export type ext4 (rw)
That’s it now I got my files back,
Info: Linux I/O Performance Tests For HDD ageing calculation
Hard Disk Data Transfer Speed measuring technique
How do you find out how fast is your hard disk under Linux? Is it running at SATA I (150 MB/s) or SATA II (300 MB/s) speed without opening computer case or chassis?
hdparm -tT /dev/sda
Output:
/dev/sda:
Timing cached reads: 19884 MB in 2.00 seconds = 9954.83 MB/sec
Timing buffered disk reads: 276 MB in 3.00 seconds = 91.88 MB/sec
To find HDD supported speed
hdparm -I /dev/sda | grep -i speed
Output:
* Gen1 signaling speed (1.5Gb/s) * Gen2 signaling speed (3.0Gb/s) * Gen3 signaling speed (6.0Gb/s)
Similarly you can use the dd command as follows to get speed info too:
Disk speed indicative of performance, different test different things, on virtual environments (such as OpenVZ and KVM) and dedi, some tests might be better for some of them.
dd if=/dev/zero of=test bs=64k count=16k conv=fdatasync
16384+0 records in 16384+0 records out 1073741824 bytes (1.1 GB) copied, 24.6998 s, 43.5 MB/
How to judge your result (note that this is only accurate for the exact test above)
- 0-25 MB/s -> Garbage
- 25-70 MB/s -> Acceptable
- 70-120 MB/s -> Good
- >120 MB/s -> Excellent
Howto: Installing 3Ware tw_cli RAID monitoring software utility
3ware CLI is a command line interface for managing 3ware RAID Controllers. We can use the CLI to view unit status and version information and perform maintenance functions such as adding or removing drives. 3ware CLI also includes advanced features for creating and deleting RAID units online.
More useful commands here: http://www.watters.ws/mediawiki/index.php/RAID_controller_commands
The 3ware CLI is supported under the following operating systems:
• Mac OS X 10.4.6 or later, running in a Mac Pro or Power Mac® G5
(PowerPC-based) with PCI Express®
• Windows®. Windows 2000, Windows XP, and Windows Server 2003,
both 32-bit and 64-bit.
• Linux®. Redhat, SuSE, both 32-bit and 64-bit.
• FreeBSD®, both 32-bit and 64-bit.
Installation steps
root@drupaldedicated:~# vi /etc/apt/sources.list
Add the following lines in end of the line
# 3Ware
deb http://jonas.genannt.name/debian lenny restricted
root@drupaldedicated:~# wget -O - http://jonas.genannt.name/debian/jonas_genannt.pub | apt-key add - root@drupaldedicated:~# apt-get update root@drupaldedicated:~# apt-cache search 3ware root@drupaldedicated:~# aptitude install 3ware-3dm2-binary 3ware-cli-binary root@drupaldedicated:~# cd /etc/3dm2 root@drupaldedicated:~# cp 3dm2.conf 3dm2.conf-dist root@drupaldedicated:~# vi 3dm2.conf
Edit 3dm2.conf
set : RemoteAccess 1
root@drupaldedicated:~# /etc/init.d/3dm2 restart
Browse to https://yourhost:888/
Select 3DM 2 Settings and change the default password 3ware to something secure. If you lock yourself out, you can copy the original config file back in place as it has the default password.
To initial checking RAID drives use the below commands.
root@drupaldedicated:~# tw_cli info
Output:
Ctl Model (V)Ports Drives Units NotOpt RRate VRate BBU ------------------------------------------------------------------------ c0 8006-2LP 2 2 1 0 3 - - root@drupaldedicated:~# tw_cli info
Output :
Unit UnitType Status %RCmpl %V/I/M Stripe Size(GB) Cache AVrfy ------------------------------------------------------------------------------ u0 RAID-1 OK - - - 465.761 OFF - Port Status Unit Size Blocks Serial --------------------------------------------------------------- p0 OK u0 465.76 GB 976773168 WD-WMAYUE464012 p1 OK u0 465.76 GB 976773168 WD-WMAYUE397313
Type the following command to view smart information about the hard disk behind 3Ware RAID card, enter:
root@drupaldedicated:~# smartctl -a -d 3ware,0 /dev/twa0 root@drupaldedicated:~# smartctl -a -d 3ware,1 /dev/twa0