Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Commands used for working with Raid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
shwag
n00b
n00b


Joined: 24 Sep 2003
Posts: 24
Location: Los Angeles, CA

PostPosted: Fri Jan 23, 2004 9:53 am    Post subject: Commands used for working with Raid Reply with quote

#
# -----------------------------------
# Commands used for working with Raid
# -----------------------------------
#
#
# Latest Version:
# ==============
# http://www.1U-Raid5/HowTo/Commands.uhow2.txt
#
#
#
# To Define your Raid Array
# -------------------------
# ln -s /etc/raidxx.conf /etc/raidtab
#
#
# To Stop and Start the Raid Array
# --------------------------------
# /etc/init.d/raid2 stop
# /etc/init.d/raid2 start
#
# -- or --
#
# raidstop /dev/md0
# raidstart /dev/md0
#
#
# Config Files
# ------------
# /etc/{raid}/raidtab
# raidstart -a
#
# /etc/mdtab
# mdadd -ar ( mdcreate )
#
#
# To Create the Raid Devices
# --------------------------
#
# raidadd -a
# md0 : inactive hdc1 hde1 16402302 blocks
#
# raidrun /dev/md0
# md0 : active raid0 hdc1 hde1 16401920 blocks 256k chunks
# -- turn it on
#
# raidstart /dev/md0
#
#
# To Initialize Raid
# ------------------
# mkraid -V - version info
# mkraid /dev/md0
#
# mkraid -force /dev/md0
#
# mkraid -c /etc/raidtab /dev/md0
# mkraid is only relevant for RAID 1, 4, and 5 devices
# mkraid: aborted
#
# - or -
#
# http://www.cse.unsw.edu.au/~neilb/source/mdctl/mdctl-0.5.tgz
# mdctl --assemble [ --force ] /dev/md0 /dev/hdc1 /dev/hde1 /dev/hdg1
#
# http://www.cse.unsw.edu.au/~neilb/source/mdadm/
# mdadm --examine /dev/sda1
# mdadm --examine /dev/sdb1
# mdadm --examine /dev/sdc1
# mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1
#
# mdadm --create /dev/md0 --verbose --level=mirror --raid-devices=2 /dev/sdb1 /dev/sdc1
#
# ???
# mdadm -R -A /dev/md0 /dev/hdx /dev/hdy
#
#
# To Check if its recognized
# --------------------------
# cat /proc/mdstat
# Personalities : [1 linear] [2 raid0] [3 raid1] [4 raid5]
# read_ahead 128 sectors
# md0 : active raid0 hdc1 hde1 16401920 blocks 256k chunks
# md1 : inactive
#
#
# To Format a NEW raid device
# ---------------------------
# mkfs.ext2 /dev/md0
# mke2fs -b 4096 -R stride=16 /dev/md0
# mke2fs -m 1 /dev/md0
#
# mke2fs -b 4096 -i 16384 -R stride=32 -s sparse-super-flag /dev/md0
#
# tune2fs -c 1 -i 1d -m 10 /dev/md0
#
#
# - for Ext3 Journeling FS ( download new e2fsprogs-1.25 )
# - define ext3 in /etc/fstab
# mke2fs -j /dev/md0
#
# -- or --
#
# mkreiserfs /dev/md0
#
#
#
# To Check the formating before mounting
# --------------------------------------
# e2fsck /dev/md0
#
# e2fsck -yf /dev/md0 - just fix it ( very dangerous though )
#
#
# To Mount and use the Raid devices
# ---------------------------------
# mkdir /Raid5 ; mount /dev/md0 /Raid5
#
#
# To Un-mount the Raid devices
# ----------------------------
# umount /Raid5
#
# To Stop Raid
# ------------
# raidstop /dev/md0
# cat /proc/mdstat -- to verify devices not listed
#
# To Restart Raid
# ---------------
# raidstart /dev/md0
# raidstart -a
# raidrun -a
# cat /proc/mdstat -- to verify devices not listed
#
#
# HotAdd and Remove /dev/sdb
# -----------------
# mdadm /dev/md0 --fail /dev/sda1
# mdadm /dev/md0 --remove /dev/sda1
#
#
# -- or --
#
# raidhotremove -->> without running: "raidstop /dev/md0"
#
# raidsetfaulty /dev/md0 /dev/sdb2
# raidhotremove /dev/md0 /dev/sdb2
#
# -- after adding the new disk ... watch it resync
# raidhotadd /dev/md0 /dev/sdb2
#
#
# Test your RAID Systems
# ----------------------
# http://www.1U-Raid5.net/Testing
#
#
# Backup data on your RAID systems
# --------------------------------
# http://www.Linux-Backup.net
#
#
#
# end of file
Back to top
View user's profile Send private message
kamikaze04
Guru
Guru


Joined: 28 Mar 2004
Posts: 366
Location: Valencia-Spain

PostPosted: Sat Jan 15, 2005 1:08 pm    Post subject: Reply with quote

Useful, although mdadm could be better
_________________
Todo lo que quisiste saber sobre google en: www.noticiasgoogle.es


Last edited by kamikaze04 on Mon Jan 17, 2005 1:40 am; edited 1 time in total
Back to top
View user's profile Send private message
Zviratko
Tux's lil' helper
Tux's lil' helper


Joined: 21 Feb 2004
Posts: 106
Location: Prague, Czech Republic

PostPosted: Sun Jan 16, 2005 11:19 pm    Post subject: Reply with quote

FYI, most of the tools mentioned are crap, for direct RAID manipulation use mdadm - it's much more flexible.

But I haven't yet figured out how to start an array with modular kernel RAID without raidstart...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum