www.linuxexpert.ro

Tutorials

  • Home
  • BGP Tutorials
    • Remove private AS
  • cPanel Tutorials
    • Install ImageMagick on cPanel
    • Install Softaculous
  • Linux Tutorials
    • Auto-reboot Linux after kernel panic
    • Building a firewall with Iptables
    • Change array RAID 1 disk order
    • Configure ntfs-3g on Linux Slackware
    • DHCP Option Codes
    • DansGuardian with Squid and ClamAV
    • Fetchmail for Gmail accounts
    • Install Zend & APC PHP Optimizers
    • Install Atheros AR242x PCI Express Adapter
    • Install awstats with DirectAdmin
    • Install DBD::mysql via CPAN shell
    • Install DjbDNS on Ubuntu
    • Installing fail2ban on Centos 5
    • Install GoDaddy SSL Certificate
    • Install i386 packages under x86_64
    • Install Linux via USB flashdrive
    • Install ModSecurity2 on Apache2.0.x
    • Install Nginx on CentOS
    • Install webalizer with ispconfig
    • Install intel A/B/G/N wireless on linux
    • Kernel Upgrade
    • Mobile phone access via bluetooth
    • Optimize MySQL
    • Optimize Qmail
    • Optimize server load
    • Optimize and Tune Apache for performance
    • Optimize and Tune Nginx for performance
    • Perfect Mailserver on Debian
    • Pidgin "Now Playing" Status Message
    • PHP hardening
    • PHP hardening with Suhosin
    • PHP5 Support allong with PHP4
    • Previewing your site before making DNS changes
    • Proxy Auto Configuration
    • PXE boot install rescue
    • Setup awstats on CentOS
    • Setup EC2 Amazon L2TP IPSec VPN
    • Setup email piping with Qmail
    • Setup Exim with DKIM
    • Setup Exim smart relay with cPanel
    • Setup OpenVPN
    • Setup postfix on nonstandard port
    • Setup SS5 Socks Proxy
    • Setup vsftp with no shell access
    • Sendmail smart relay with gmail auth
    • Squid proxy NCSA authentication
    • Tcpdump filters
    • Upgrade PHP to 5.3 in Plesk 10
    • Useful regular expressions
    • X with [SiS] 771/671 VGA controller
  • Joomla Tutorials
    • Hardening Joomla
    • Module Positions
    • Remove Joomla description meta tag
  • Looking Glasses
  • Optimize Firefox
  • Security
    • Crack WiFi WEP passwords
    • Defend against UDP isc.org DNS query DDOS
    • Detect DDoS attack
    • Remove malware from web sites
    • Sniff SSL passwords with ettercap
    • Snort2BGP
    • Track Hackers
    • What Is My IP
  • Troubleshooting
    • Grub error no such disk
    • named dumping master file: tmp-XXXXXXXXXX: open: permission denied
    • Nginx 413 Request Entity Too Large
    • SSH conection closed by remote host
    • Troubleshooting sis190.c
  • Unix Tutorials
    • FreeBSD reset root password
    • Installing snort on OpenBSD
    • Unix Toolbox
  • Virtualization Tutorials
    • Convert VirtualBox image to VMWare
    • VMware SNMP Enable
  • VoIP Tutorials
    • Install Elastix
    • Qos for Asterisk

Who's Online

We have 9 guests and no members online

Most Read

  • Setup SS5 Socks Proxy
  • Install webalizer with ispconfig
  • Sniff SSL passwords with ettercap
  • __404__
  • Optimize and Tune Apache for performance

Products and Services

  • Home
  • Linux Products and Services
  • Buy VPN Account
  • Privacy Policy for Linuxexpert
  • Remove malware

Change array RAID 1 disk order

  • Print
  • Email
Details
Parent Category: Tutorials
Published: 02 November 2010
Hits: 8970

In this tutorial i'll show you how to change the RAID1 disks array order from sdaX[1] sdbX[0] to sdaX[0],sdbX[1]

Let's take this example


Blackbird:~# cat /proc/mdstat
Personalities : [raid1]
md5 : active raid1 hdb1[0] hda1[1]
312568576 blocks [2/2] [UU]

unused devices: <none>

We want to change from hdb1[0] hda1[1] to hda1[0] hdb1[1]

First we declare the hdb1 faulty and set the array from 2 to 1 disk using mdadm grow feature


Blackbird:~# mdadm --manage --set-faulty /dev/md5 /dev/hdb1
mdadm: set /dev/hdb1 faulty in /dev/md5
Blackbird:~# mdadm /dev/md5 -r /dev/hdb1
mdadm: hot removed /dev/hdb1
Blackbird:~# cat /proc/mdstat
Personalities : [raid1]
md5 : active raid1 hda1[1]
312568576 blocks [2/1] [_U]

unused devices: <none>
Blackbird:~# mdadm --detail /dev/md5
/dev/md5:
Version : 00.90
Creation Time : Sun Oct 21 11:29:15 2007
Raid Level : raid1
Array Size : 312568576 (298.09 GiB 320.07 GB)
Used Dev Size : 312568576 (298.09 GiB 320.07 GB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 5
Persistence : Superblock is persistent

Update Time : Tue Nov  2 16:50:24 2010
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

UUID : 1c2849b4:897dbb3a:b5f0e5d4:d7538707
Events : 0.15314

Number   Major   Minor   RaidDevice State
0       0        0        0      removed
1       3        1        1      active sync   /dev/hda1
Blackbird:~# mdadm --grow --force -n 1 /dev/md5
Blackbird:~# mdadm --detail /dev/md5          
/dev/md5:
Version : 00.90
Creation Time : Sun Oct 21 11:29:15 2007
Raid Level : raid1
Array Size : 312568576 (298.09 GiB 320.07 GB)
Used Dev Size : 312568576 (298.09 GiB 320.07 GB)
Raid Devices : 1
Total Devices : 1
Preferred Minor : 5
Persistence : Superblock is persistent

Update Time : Tue Nov  2 16:51:44 2010
State : clean
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0

UUID : 1c2849b4:897dbb3a:b5f0e5d4:d7538707
Events : 0.15320

Number   Major   Minor   RaidDevice State
0       3        1        0      active sync   /dev/hda1

Then we grow this array to 2 disks insert the second disk and syncronize the array:


Blackbird:~# mdadm --grow -n 2 /dev/md5       
Blackbird:~# mdadm /dev/md5 -a /dev/hdb1
mdadm: added /dev/hdb1
Blackbird:~# cat /proc/mdstat
Personalities : [raid1]
md5 : active raid1 hdb1[2] hda1[0]
312568576 blocks [2/1] [U_]
[>....................]  recovery =  0.0% (170752/312568576) finish=91.4min speed=56917K/sec

unused devices: <none>
Blackbird:~#

Note:

We use Hosting and VPS Hosting, from: www.star-host.org

We like and trust them.

Good prices, high security.

fShare
Tweet