DapperDrakeInstallAndSettings

初めに

現状

  • Ubuntu8.04LTS
    • 64bit
    • ディレクトリ状況
      Filesystem            Size  Used Avail Use% Mounted on
      /dev/md0               47G   11G   35G  23% /
      varrun                4.0G  292K  4.0G   1% /var/run
      varlock               4.0G     0  4.0G   0% /var/lock
      udev                  4.0G  144K  4.0G   1% /dev
      devshm                4.0G   12K  4.0G   1% /dev/shm
      lrm                   4.0G   18M  3.9G   1% /lib/modules/2.6.24-21-generic/volatile
      /dev/md1              100G   72G   23G  76% /home
      /dev/md2              232G  183G   37G  84% /media/raiddisk

移行要件

  • システムはそのまま
  • 下記の構成でパーティションを準備する。
    マウント先PV名パーティションLVM容量ファイルシステム
    VG名容量LV名
    1/boot/dev/md0/dev/sda1,/dev/sdb1---200MBext3
    2//dev/md1/dev/sda2,/dev/sdb2sg1t995GBsystem45GBext3
    3/homehome100GBext3
    4/media/datadata650GBext3
    5-未割り当て200GB-
    6--/dev/sda3---5GBswap
    7--/dev/sdb3---5GBswap

準備

  • LVM2インストール
    sudo apt-get install lvm2

作業ログ

  • パーティション準備
    コマンド (m でヘルプ): p
    
    Disk /dev/sde: 1000.2 GB, 1000204886016 bytes
    255 heads, 63 sectors/track, 121601 cylinders
    Units = シリンダ数 of 16065 * 512 = 8225280 bytes
    Disk identifier: 0x0e787708
    
    デバイス Boot      Start         End      Blocks   Id  System
    /dev/sde1               1          25      200781   fd  Linux raid 自動検出
    /dev/sde2              26      120995   971691525   fd  Linux raid 自動検出
    /dev/sde3          120996      121601     4867695  
  • raid1準備
    $ sudo mdadm --create /dev/md3 --level=1 --raid-devices=2 /dev/sde1 missing
    mdadm: array /dev/md3 started.
    $ sudo mdadm --create /dev/md4 --level=1 --raid-devices=2 /dev/sde2 missing
    mdadm: array /dev/md4 started.
    • 確認
      $ cat /proc/mdstat 
      Personalities : [linear] [multipath] [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] 
      md4 : active raid1 sde2[0]
            971691456 blocks [2/1] [U_]
            
      md3 : active raid1 sde1[0]
            200704 blocks [2/1] [U_]
  • boot用のmd3をフォーマット
    $ sudo mkfs.ext3 /dev/md3
    mke2fs 1.40.8 (13-Mar-2008)
    Filesystem label=
    OS type: Linux
    Block size=1024 (log=0)
    Fragment size=1024 (log=0)
    50200 inodes, 200704 blocks
    10035 blocks (5.00%) reserved for the super user
    First data block=1
    Maximum filesystem blocks=67371008
    25 block groups
    8192 blocks per group, 8192 fragments per group
    2008 inodes per group
    Superblock backups stored on blocks: 
    	8193, 24577, 40961, 57345, 73729
    
    Writing inode tables: done                            
    Creating journal (4096 blocks): done
    Writing superblocks and filesystem accounting information: done
    
    This filesystem will be automatically checked every 23 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.
  • md4にPV作成
    # pvcreate -v /dev/md4
        Set up physical volume for "/dev/md4" with 1943382912 available sectors
        Zeroing start of device /dev/md4
      Physical volume "/dev/md4" successfully created
  • VG作成
    # vgcreate sg1t /dev/md4
      Volume group "sg1t" successfully created
    • 確認
      # vgdisplay 
        --- Volume group ---
        VG Name               sg1t
        System ID             
        Format                lvm2
        Metadata Areas        1
        Metadata Sequence No  1
        VG Access             read/write
        VG Status             resizable
        MAX LV                0
        Cur LV                0
        Open LV               0
        Max PV                0
        Cur PV                1
        Act PV                1
        VG Size               926.68 GB
        PE Size               4.00 MB
        Total PE              237229
        Alloc PE / Size       0 / 0   
        Free  PE / Size       237229 / 926.68 GB
        VG UUID               26VuuW-672B-9Fga-oShg-ijXX-3xi4-iyt1RD
  • LVMの生成
    • ルート用ディレクトリ
      # lvcreate -nroot -L45g sg1t
        Logical volume "root" created
      # lvcreate -nhome -L100g sg1t
        Logical volume "home" created
      # lvcreate -ndata -L650g sg1t
        Logical volume "data" created
    • 確認
      # lvdisplay 
        --- Logical volume ---
        LV Name                /dev/sg1t/root
        VG Name                sg1t
        LV UUID                8JvdkE-WKN7-PzBb-27zP-xlUC-P68d-cPKLlD
        LV Write Access        read/write
        LV Status              available
        # open                 0
        LV Size                45.00 GB
        Current LE             11520
        Segments               1
        Allocation             inherit
        Read ahead sectors     0
        Block device           253:0
         
        --- Logical volume ---
        LV Name                /dev/sg1t/home
        VG Name                sg1t
        LV UUID                g9RL4Q-Vo5u-aW3j-HlPP-YQTr-oQtX-CJAjSD
        LV Write Access        read/write
        LV Status              available
        # open                 0
        LV Size                100.00 GB
        Current LE             25600
        Segments               1
        Allocation             inherit
        Read ahead sectors     0
        Block device           253:1
         
        --- Logical volume ---
        LV Name                /dev/sg1t/data
        VG Name                sg1t
        LV UUID                kBNjcV-LV9j-KWkQ-PkdU-hzbX-ZMD1-Abw7AO
        LV Write Access        read/write
        LV Status              available
        # open                 0
        LV Size                650.00 GB
        Current LE             166400
        Segments               1
        Allocation             inherit
        Read ahead sectors     0
        Block device           253:2
  • FileSystem?を作る
    # mkfs.ext3 /dev/sg1t/root
    # mkfs.ext3 /dev/sg1t/home
    # mkfs.ext3 /dev/sg1t/data

リロード   新規 編集 凍結 差分 添付 複製 改名   トップ 一覧 検索 最終更新 バックアップ   ヘルプ   最終更新のRSS
Last-modified: 2010-03-14 (日) 07:00:18 (2628d)