2012秋のファイルサーバ復旧 06 データ領域用HDDの設定など2

前回というか今朝というか昨日の朝はfsckかけた状態でおわりました。
手順は前回を参照。
メモ: 2012秋のファイルサーバ復旧 05 データ領域用HDDの設定など

帰宅したら結果はこんな感じ。

# fsck -n /dev/sdb
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Warning!  /dev/sdb is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
00main has gone 245 days without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
00main: 255236/366297088 files (3.9% non-contiguous), 699018545/732566646 blocks

エラーメッセージがでてないのでOKだったのでしょう。
時間がもったいないので続けてsdcもやります。
酔ってて眠いので仕掛けたら仮眠zzz


# fsck -n /dev/sdc
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Warning!  /dev/sdc is mounted.
Warning: skipping journal recovery because doing a read-only filesystem check.
00mirror has gone 245 days without being checked, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
00mirror: 255236/366297088 files (2.3% non-contiguous), 710878251/732566646 blocks

目覚めたらこんなかんじでした。
やはりエラーメッセージはなし。
大丈夫っぽい。

先に進みます。
次はもうひとつのストレージとして扱っていたもの。
前回の投稿ではD,Eとしていたものです。
シャットダウンして接続して起動します。
起動したら認識されているか確認

# ls /dev
MAKEDEV          network_throughput  rawctl    tty16  tty44           usbdev1.2_ep00
X0R              null                root      tty17  tty45           usbdev1.2_ep02
bus              nvram               rtc       tty18  tty46           usbdev1.2_ep81
console          oldmem              sda       tty19  tty47           usbdev2.1_ep00
core             parport0            sda1      tty2   tty48           usbdev2.1_ep81
cpu              parport1            sda2      tty20  tty49           usbdev3.1_ep00
cpu_dma_latency  parport2            sda3      tty21  tty5            usbdev3.1_ep81
disk             parport3            sdb       tty22  tty50           usbdev4.1_ep00
fd               port                sdc       tty23  tty51           usbdev4.1_ep81
full             ppp                 sdd       tty24  tty52           usbdev5.1_ep00
hidraw0          ptmx                sde       tty25  tty53           usbdev5.1_ep81
hidraw1          pts                 sg0       tty26  tty54           usbdev5.2_ep00
hpet             ram                 sg1       tty27  tty55           usbdev5.2_ep81
initctl          ram0                sg2       tty28  tty56           usbdev5.2_ep82
input            ram1                sg3       tty29  tty57           vcs
kmsg             ram10               sg4       tty3   tty58           vcs2
log              ram11               shm       tty30  tty59           vcs3
loop0            ram12               snapshot  tty31  tty6            vcs4
loop1            ram13               stderr    tty32  tty60           vcs5
loop2            ram14               stdin     tty33  tty61           vcs6
loop3            ram15               stdout    tty34  tty62           vcsa
loop4            ram2                systty    tty35  tty63           vcsa2
loop5            ram3                tty       tty36  tty7            vcsa3
loop6            ram4                tty0      tty37  tty8            vcsa4
loop7            ram5                tty1      tty38  tty9            vcsa5
mapper           ram6                tty10     tty39  ttyS0           vcsa6
mcelog           ram7                tty11     tty4   ttyS1           zero
md0              ram8                tty12     tty40  ttyS2
mem              ram9                tty13     tty41  ttyS3
net              ramdisk             tty14     tty42  urandom
network_latency  random              tty15     tty43  usbdev1.1_ep81

されてます。sddとsde。

ではマウント先を作成してマウント

# mkdir -p /var/storage/01/main
# mount /dev/sdd /var/storage/01/main/
# mkdir -p /var/storage/01/mirror
# mount /dev/sde /var/storage/01/mirror/

マウント完了。中身を確認

# ls /var/storage/01/main/
data  lost+found  this_is_main
# ls /var/storage/01/mirror/
data  lost+found  this_is_mirror

OKでした。
では同期実行。

# rsync -av --delete /var/storage/01/main/data /var/storage/01/mirror
sending incremental file list
data/.recycle/
(略)

sent 11270867394 bytes  received 1628 bytes  29313053.37 bytes/sec
total size is 2799003471955  speedup is 248.34

終わりました。早い。
まあこっちのドライブはほとんど変更したなかったので早くて当然ですな。
一応確認のためにdfしてみます。

# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/sda3             14729016   1280404  12688336  10% /
/dev/sda1               101086     12180     83687  13% /boot
tmpfs                  1020808         0   1020808   0% /dev/shm
/dev/sdb             2884285104 2750092700         0 100% /var/storage/00/main
/dev/sdc             2884285104 2797531524         0 100% /var/storage/00/mirror
/dev/sdd             2884285104 2736362616   1409160 100% /var/storage/01/main
/dev/sde             2884285104 2736362632   1409144 100% /var/storage/01/mirror

だいたいあってるので大丈夫そうです。
前回の投稿通り、rsyncはチェックサムで比較しているらしいので大丈夫なはずです。

次の手順です。
sddとsdeにLABELを設定します。

# e2label /dev/sdd

# e2label /dev/sdd 01main
# e2label /dev/sdd
01main
# e2label /dev/sde

# e2label /dev/sde 01mirror
# e2label /dev/sde
01mirror

設定がおわったのでfstabに設定します。
前回の メモ: 2012秋のファイルサーバ復旧 05 データ領域用HDDの設定など 同様に メモ: 3TBのドライブはfdiskじゃだめらしい っぽくやりつつLABELでの設定です。

# vi /etc/fstab

そして下記を追記です。

LABEL=01main            /var/storage/01/main    ext3    defaults        0 0
LABEL=01mirror          /var/storage/01/mirror  ext3    defaults        0 0

保存したら再起動。
再起動したら確認

# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/sda3             14729016   1280456  12688284  10% /
/dev/sda1               101086     12180     83687  13% /boot
tmpfs                  1020808         0   1020808   0% /dev/shm
/dev/sdb             2884285104 2750092700         0 100% /var/storage/00/main
/dev/sdc             2884285104 2797531524         0 100% /var/storage/00/mirror
/dev/sdd             2884285104 2736362616   1409160 100% /var/storage/01/main
/dev/sde             2884285104 2736362632   1409144 100% /var/storage/01/mirror
# ls /var/storage/01/main/
data  lost+found  this_is_main
# ls /var/storage/01/mirror/
data  lost+found  this_is_mirror

OKでした。
次はいよいよ買ってきたHDDのフォーマット。
また電源落とします。

で、接続したら起動。
起動したら確認

# ls /dev
MAKEDEV          network_throughput  rawctl    tty14  tty42  urandom
X0R              null                root      tty15  tty43  usbdev1.1_ep81
bus              nvram               rtc       tty16  tty44  usbdev1.2_ep00
console          oldmem              sda       tty17  tty45  usbdev1.2_ep02
core             parport0            sda1      tty18  tty46  usbdev1.2_ep81
cpu              parport1            sda2      tty19  tty47  usbdev2.1_ep00
cpu_dma_latency  parport2            sda3      tty2   tty48  usbdev2.1_ep81
disk             parport3            sdb       tty20  tty49  usbdev3.1_ep00
fd               port                sdc       tty21  tty5   usbdev3.1_ep81
full             ppp                 sdd       tty22  tty50  usbdev4.1_ep00
hidraw0          ptmx                sde       tty23  tty51  usbdev4.1_ep81
hidraw1          pts                 sdf       tty24  tty52  usbdev5.1_ep00
hpet             ram                 sg0       tty25  tty53  usbdev5.1_ep81
initctl          ram0                sg1       tty26  tty54  usbdev5.2_ep00
input            ram1                sg2       tty27  tty55  usbdev5.2_ep81
kmsg             ram10               sg3       tty28  tty56  usbdev5.2_ep82
log              ram11               sg4       tty29  tty57  vcs
loop0            ram12               sg5       tty3   tty58  vcs2
loop1            ram13               shm       tty30  tty59  vcs3
loop2            ram14               snapshot  tty31  tty6   vcs4
loop3            ram15               stderr    tty32  tty60  vcs5
loop4            ram2                stdin     tty33  tty61  vcs6
loop5            ram3                stdout    tty34  tty62  vcsa
loop6            ram4                systty    tty35  tty63  vcsa2
loop7            ram5                tty       tty36  tty7   vcsa3
mapper           ram6                tty0      tty37  tty8   vcsa4
mcelog           ram7                tty1      tty38  tty9   vcsa5
md0              ram8                tty10     tty39  ttyS0  vcsa6
mem              ram9                tty11     tty4   ttyS1  zero
net              ramdisk             tty12     tty40  ttyS2
network_latency  random              tty13     tty41  ttyS3

sdf が増えているのでOK。
フォーマットします。
今回も3TBなのでfdiskとかじゃだめです。
メモ: 3TBのドライブはfdiskじゃだめらしい
にある通りにやります。

# mkfs.ext3 /dev/sdf
mke2fs 1.39 (29-May-2006)
/dev/sdf is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
366297088 inodes, 732566646 blocks
36628332 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

無事終わったようです。
マウント先を作成してマウントします。

# mkdir -p /var/storage/02/main
# mount /dev/sdf /var/storage/02/main/

dfしてみます

# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/sda3             14729016   1280520  12688220  10% /
/dev/sda1               101086     12180     83687  13% /boot
tmpfs                  1020808         0   1020808   0% /dev/shm
/dev/sdb             2884285104 2750092700         0 100% /var/storage/00/main
/dev/sdc             2884285104 2797531524         0 100% /var/storage/00/mirror
/dev/sdd             2884285104 2736362616   1409160 100% /var/storage/01/main
/dev/sde             2884285104 2736362632   1409144 100% /var/storage/01/mirror
/dev/sdf             2884285104    205944 2737565832   1% /var/storage/02/main

良い感じです。
ではLABELを設定してfstabを編集します。

# e2label /dev/sdf

# e2label /dev/sdf 02main
# e2label /dev/sdf
02main
# vi /etc/fstab

そして下記を追記です。

LABEL=02main            /var/storage/02/main    ext3    defaults        0 0

これでOKのはずなのでシャットダウンして最後のHDDを追加します。
これでもうマザーボードのSATAの空きもないしPCIのSATA拡張ボードの空きも無くなるので今度HDDがいっぱいになったらマザーから買い直しです。

でもプレミアとかアフターエフェクト使っているとあっという間に…。
恐ろしい…。

さて起動しおわったらLABELを設定したドライブと最後のドライブの状態を確認です。

# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/sda3             14729016   1280572  12688168  10% /
/dev/sda1               101086     12180     83687  13% /boot
tmpfs                  1020808         0   1020808   0% /dev/shm
/dev/sdb             2884285104 2750092700         0 100% /var/storage/00/main
/dev/sdc             2884285104 2797531524         0 100% /var/storage/00/mirror
/dev/sdd             2884285104 2736362616   1409160 100% /var/storage/01/main
/dev/sde             2884285104 2736362632   1409144 100% /var/storage/01/mirror
/dev/sdf             2884285104    205944 2737565832   1% /var/storage/02/main

先程のは無事認識されています。
次は最後のドライブも同じように進めます。

# ls /dev
MAKEDEV          network_throughput  rawctl    tty12  tty40  ttyS2
X0R              null                root      tty13  tty41  ttyS3
bus              nvram               rtc       tty14  tty42  urandom
console          oldmem              sda       tty15  tty43  usbdev1.1_ep81
core             parport0            sda1      tty16  tty44  usbdev1.2_ep00
cpu              parport1            sda2      tty17  tty45  usbdev1.2_ep02
cpu_dma_latency  parport2            sda3      tty18  tty46  usbdev1.2_ep81
disk             parport3            sdb       tty19  tty47  usbdev2.1_ep00
fd               port                sdc       tty2   tty48  usbdev2.1_ep81
full             ppp                 sdd       tty20  tty49  usbdev3.1_ep00
hidraw0          ptmx                sde       tty21  tty5   usbdev3.1_ep81
hidraw1          pts                 sdf       tty22  tty50  usbdev4.1_ep00
hpet             ram                 sdg       tty23  tty51  usbdev4.1_ep81
initctl          ram0                sg0       tty24  tty52  usbdev5.1_ep00
input            ram1                sg1       tty25  tty53  usbdev5.1_ep81
kmsg             ram10               sg2       tty26  tty54  usbdev5.2_ep00
log              ram11               sg3       tty27  tty55  usbdev5.2_ep81
loop0            ram12               sg4       tty28  tty56  usbdev5.2_ep82
loop1            ram13               sg5       tty29  tty57  vcs
loop2            ram14               sg6       tty3   tty58  vcs2
loop3            ram15               shm       tty30  tty59  vcs3
loop4            ram2                snapshot  tty31  tty6   vcs4
loop5            ram3                stderr    tty32  tty60  vcs5
loop6            ram4                stdin     tty33  tty61  vcs6
loop7            ram5                stdout    tty34  tty62  vcsa
mapper           ram6                systty    tty35  tty63  vcsa2
mcelog           ram7                tty       tty36  tty7   vcsa3
md0              ram8                tty0      tty37  tty8   vcsa4
mem              ram9                tty1      tty38  tty9   vcsa5
net              ramdisk             tty10     tty39  ttyS0  vcsa6
network_latency  random              tty11     tty4   ttyS1  zero

sdgが増えていますね。
フォーマットします。

# mkfs.ext3 /dev/sdg
mke2fs 1.39 (29-May-2006)
/dev/sdg is entire device, not just one partition!
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
366297088 inodes, 732566646 blocks
36628332 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
        102400000, 214990848, 512000000, 550731776, 644972544

Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

マウント先を作成してマウントします。

# mkdir -p /var/storage/02/mirror
# mount /dev/sdg /var/storage/02/mirror/

dfしてみます

# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/sda3             14729016   1280576  12688164  10% /
/dev/sda1               101086     12180     83687  13% /boot
tmpfs                  1020808         0   1020808   0% /dev/shm
/dev/sdb             2884285104 2750092700         0 100% /var/storage/00/main
/dev/sdc             2884285104 2797531524         0 100% /var/storage/00/mirror
/dev/sdd             2884285104 2736362616   1409160 100% /var/storage/01/main
/dev/sde             2884285104 2736362632   1409144 100% /var/storage/01/mirror
/dev/sdf             2884285104    205944 2737565832   1% /var/storage/02/main
/dev/sdg             2884285104    205944 2737565832   1% /var/storage/02/mirror

LABEL設定します。

# e2label /dev/sdg

# e2label /dev/sdg 02mirror
# e2label /dev/sdg
02mirror
# vi /etc/fstab

そして下記を追記です。

LABEL=02mirror            /var/storage/02/mirror    ext3    defaults        0 0

再起動してちゃんと認識されるか確認です。

# df
Filesystem           1K-ブロック    使用   使用可 使用% マウント位置
/dev/sda3             14729016   1280624  12688116  10% /
/dev/sda1               101086     12180     83687  13% /boot
tmpfs                  1020808         0   1020808   0% /dev/shm
/dev/sdb             2884285104 2750092700         0 100% /var/storage/00/main
/dev/sdc             2884285104 2797531524         0 100% /var/storage/00/mirror
/dev/sdd             2884285104 2736362616   1409160 100% /var/storage/01/main
/dev/sde             2884285104 2736362632   1409144 100% /var/storage/01/mirror
/dev/sdf             2884285104    205944 2737565832   1% /var/storage/02/main
/dev/sdg             2884285104    205944 2737565832   1% /var/storage/02/mirror

ちゃんとできてました。
これで環境は全部整いました。

sdfとsdgにもthis_is_xxxのファイルを作成しておきます。

# touch /var/storage/02/main/this_is_main
# touch /var/storage/02/mirror/this_is_mirror

ではフルになっているドライブのデータを一気にコピーします。
が、まず試しに要領の少ないsvnのディレクトリを先に試してみます。
いつものオプションのdeleteは不要なのでつけてません。

# rsync -av /var/storage/00/main/svn /var/storage/02/main
sending incremental file list
svn/
(略)

sent 3920367 bytes  received 3192 bytes  2615706.00 bytes/sec
total size is 3909600  speedup is 1.00

早いです。一瞬です。10秒かからず。

# ls /var/storage/00/main/
data  lost+found  svn  this_is_main
# ls /var/storage/02/main/
lost+found  svn  this_is_main

ちゃんとコピーされてます。
では本命の巨大データ群をコピーします。

# rsync -av /var/storage/00/main/data /var/storage/02/main

これはも異様に時間がかかることはわかりきってるので放置して出社です。
その前に仮眠zzz。
続きはまた今夜。

あ、あと、前回くらいからソースコード等は<blockquote>
をやめて<pre>にしてます。

デザインも適用しとかないといけませんな。
あと気が向いたら過去の記事も直しとこう。多分気は向かないでしょう。面倒です。

コメント