下一篇 上一篇 目录

7. 修改现有安装

  1. : 线性 MD 是否可扩展?可以添加新的硬盘驱动器/分区并扩展现有文件系统的大小吗?
    : Miguel de Icaza < miguel@luthien.nuclecu.unam.mx> 写道
    我修改了 ext2fs 代码,使其能够识别多个设备,而不是每个文件系统一个设备的常规假设。

    因此,当您想要扩展文件系统时,您可以运行一个实用程序,该实用程序在新设备(您的额外分区)上进行适当的更改,然后您只需告诉系统使用指定的设备扩展文件系统。

    您可以在系统运行时使用新设备扩展文件系统,无需关闭系统(并且当我有额外时间时,您将能够从 ext2 卷集中删除设备,同样甚至无需进入单用户模式或任何类似的 hack)。

    您可以从我的网页获取 2.1.x 内核的补丁

    http://www.nuclecu.unam.mx/~miguel/ext2-volume
  2. : 我可以将磁盘添加到 RAID-5 阵列吗?
    : 目前(1997 年 9 月)不行,除非擦除所有数据。允许这样做的转换实用程序尚不存在。问题在于 RAID-5 阵列的实际结构和布局取决于阵列中磁盘的数量。当然,可以通过将阵列备份到磁带,删除所有数据,创建新阵列并从磁带恢复来添加驱动器。
  3. : 如果我将一个驱动器从 /dev/hdb 移动到 /dev/hdc,我的 RAID1/RAID0 集会发生什么?由于电缆/机箱尺寸/愚蠢问题,我不得不在同一个 IDE 控制器(/dev/hda/dev/hdb)上创建我的 RAID 集。现在我已经修复了一些东西,我想将 /dev/hdb 移动到 /dev/hdc。如果我只是更改 /etc/mdtab/etc/raid1.conf 文件以反映新位置,会发生什么?
    : 对于 RAID-0/线性,必须小心地以完全相同的顺序指定驱动器。因此,在上面的示例中,如果原始配置是
    mdadd /dev/md0 /dev/hda /dev/hdb
                
    
    那么新配置*必须*是
    mdadd /dev/md0 /dev/hda /dev/hdc
                
    
    对于 RAID-1/4/5,驱动器的“RAID 编号”存储在其 RAID 超级块中,因此指定磁盘的顺序并不重要。 RAID-0/线性由于其较旧的设计以及保持与此较旧设计向后兼容性的愿望而没有超级块。
  4. : 我可以将双磁盘 RAID-1 镜像转换为三磁盘 RAID-5 阵列吗?
    : 是的。 BizSystems 的 Michael 已经想出了一种巧妙的、偷偷摸摸的方法来做到这一点。但是,就像几乎所有对 RAID 阵列进行数据操作一样,它很危险且容易出现人为错误。 在开始之前进行备份
    I will make the following assumptions:
    ---------------------------------------------
    disks 
    original: hda - hdc
    raid1 partitions hda3 - hdc3
    array name /dev/md0
    
    new hda - hdc - hdd
    raid5 partitions hda3 - hdc3 - hdd3
    array name: /dev/md1
    
    You must substitute the appropriate disk and partition numbers for 
    you system configuration. This will hold true for all config file 
    examples.
    --------------------------------------------
    DO A BACKUP BEFORE YOU DO ANYTHING
    1) recompile kernel to include both raid1 and raid5
    2) install new kernel and verify that raid personalities are present
    3) disable the redundant partition on the raid 1 array. If this is a
     root mounted partition (mine was) you must be more careful.
    
     Reboot the kernel without starting raid devices or boot from rescue 
     system ( raid tools must be available )
    
     start non-redundant raid1
    mdadd -r -p1 /dev/md0 /dev/hda3
    
    4) configure raid5 but with 'funny' config file, note that there is 
      no hda3 entry and hdc3 is repeated. This is needed since the
      raid tools don't want you to do this.
    -------------------------------
    # raid-5 configuration
    raiddev                 /dev/md1
    raid-level              5
    nr-raid-disks           3
    chunk-size              32
    
    # Parity placement algorithm
    parity-algorithm        left-symmetric
    
    # Spare disks for hot reconstruction
    nr-spare-disks          0
    
    device                  /dev/hdc3
    raid-disk               0
    
    device                  /dev/hdc3
    raid-disk               1
    
    device                  /dev/hdd3
    raid-disk               2
    ---------------------------------------
     mkraid /etc/raid5.conf
    5) activate the raid5 array in non-redundant mode
    
    mdadd -r -p5 -c32k /dev/md1 /dev/hdc3 /dev/hdd3
    
    6) make a file system on the array
    
    mke2fs -b {blocksize} /dev/md1
    
    recommended blocksize by some is 4096 rather than the default 1024.
    this improves the memory utilization for the kernel raid routines and 
    matches the blocksize to the page size. I compromised and used 2048 
    since I have a relatively high number of small files on my system.
    
    7) mount the two raid devices somewhere
    
    mount -t ext2 /dev/md0 mnt0
    mount -t ext2 /dev/md1 mnt1
    
    8) move the data
    
    cp -a mnt0 mnt1
    
    9) verify that the data sets are identical
    10) stop both arrays
    11) correct the information for the raid5.conf file
      change /dev/md1 to /dev/md0
      change the first disk to read /dev/hda3
    
    12) upgrade the new array to full redundant status
     (THIS DESTROYS REMAINING raid1 INFORMATION)
    
    ckraid --fix /etc/raid5.conf
    
                
    

下一篇 上一篇 目录