/docs/MyDocs

To get this branch, use:
bzr branch http://darksoft.org/webbzr/docs/MyDocs

« back to all changes in this revision

Viewing changes to Administration/Linux/system/softraid/softraid.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2013-11-08 01:07:23 UTC
  • Revision ID: csa@dside.dyndns.org-20131108010723-gfaem1vwkt6262m1
virtualization mainly

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Creating RAID
2
 
=============
3
 
 - Creating RAID 1
4
 
    mdadm --create /dev/md2 -l 1 -n 3 --name="boot" /dev/sda1 missing missing
5
 
 - Adding another drive 
6
 
    mdadm --manage /dev/md2 -a /dev/sdb1
7
 
 - Storring current configuration (Don't forget!!!)
8
 
    mdadm --detail --scan > /etc/mdadm.conf
9
 
 
10
 
Migrating to different RAID
11
 
===========================
12
 
 - The grub accepts following syntaxis specifying root on the raid
13
 
        root=/dev/md0 md=1,/dev/sda5,/dev/sdb5
14
 
 However, the initrd normally contains /etc/mdadm.conf which defines
15
 
 UUID (UUID=af154497:441463a4:5ae73ed6:62cf7617) of the actual RAID
16
 
 to find and mount. Therefore, if raid is altered and UID is changed
17
 
 it is necesary to update initrd file. 
18
 
 * This could be achieved, for example, by performing following actions:
19
 
    a) gunzip initrd
20
 
    b) search for md0 and replace uuid with actual value
21
 
    c) pack it back 
22
 
 
23
 
Converting Disk to RAID-1 online
24
 
================================
25
 
 There is a tricky bit. The actual Ext# partion is not occupaying all the 
26
 
 space of partition but leaving a small piece to the SoftRaid superblock.
27
 
 Actually:
28
 
    a) The 64KB block is allocated to superblock
29
 
    b) After that the size of partition is made multiple of 64KB (the 
30
 
    modulus is unused)
31
 
    ' 64KB - is dependent on raid strip size
32
 
 
33
 
  - If Raid is already created the actual blocks count (1KB) could be 
34
 
  obtained with:
35
 
    cat /proc/mdstat
36
 
  The blocks in complete partition (without stripped superblock and rounding)
37
 
  are viewable with:
38
 
    fdisk -l /dev/sd<dev>
39
 
 
40
 
 - Then it's possible to resize the file system size (without touching actual
41
 
 partition size) using:
42
 
    resize2fs /dev/sd<dev> <size>
43
 
 Required 'size' is reported by 'cat /proc/mdstat' 
44
 
    * Yep. if partition is not completely full, it's more or less save to create
45
 
    RAID first, giving him opportunity to overwrite last sectors of data, find 
46
 
    appropriate size, and then resize file system.
47
 
    * Alternatively file system could be resize down (few MB, let's say) then
48
 
    RAID is created, no damage to FS, and then enlarge back to appropriate size
49
 
 
50
 
 - e2fsck will complain what sizes do not match.