Hajime Akashi's Weblog
なんとなく core dump
アーカイブ
« 11月 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
今日
XML
Search

リンク

The requested Bookmark Folder does not exist: Blogroll

 
The requested Bookmark Folder does not exist: Links
 

Today's Page Hits: 114

    
« LAN Free Backup (1) | メイン | Solaris on Mac mini »
20060721 2006年 7月 21日 金曜日
LAN Free Backup (2)

こんにちは、あかぴんです。

今度は、Ultra 40 に Solaris 10 6/06 x86-64 をインストールしたディスク
と Windows Server 2003 をインストールしたディスクをセットして検証を
実施しました。

この状態で Solaris 10 6/06 x86 を起動し、デバイスを再構成したところ
以下のように slice と partion のデバイスができていました。SPARC とは
異なり、X86 システムだけあって MBR を理解しているようです。

# devfsadm
# ls -al c2*
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0p0 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:q,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0p1 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:r,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0p2 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:s,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0p3 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:t,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0p4 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:u,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s0 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:a,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s1 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:b,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s10 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:k,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s11 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:l,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s12 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:m,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s13 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:n,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s14 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:o,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s15 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:p,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s2 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:c,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s3 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:d,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s4 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:e,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s5 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:f,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s6 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:g,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s7 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:h,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s8 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:i,raw
lrwxrwxrwx   1 root     root          52  7月 14日  19:26 c2d0s9 -> ../../devices/pci@0,0/pci-ide@7/ide@1/cmdk@0,0:j,raw
この状態で fdisk を実行してみます。
# fdisk /dev/rdsk/c2d0p0

             Total disk size is 30400 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1       Active    IFS: NTFS         0  1031    1032      3
SPARC とは異なり、きちんと NTFS 領域が見えてます。 Partition 0 はディスク全体を示すので、dd を使い MBR と Partition 1 を取り出してみます。
# dd if=/dev/rdsk/c2d0p1 of=/var/tmp/c2d0p1.dat bs=1024k
書き込まれたレコード数 8095+1
読み出されたレコード数 8095+1
# dd if=/dev/rdsk/c2d0p0 of=/var/tmp/mbr.dat count=1
書き込まれたレコード数 1+0
読み出されたレコード数 1+0
# ls -lh *.dat
-rw-r--r--   1 root     root        7.9G  7月 14日  19:32 c2d0p1.dat
-rw-r--r--   1 root     root        512   7月 14日  19:55 mbr.dat
無事吸い出せたようです。 それではデータを消してリストアできるか試してみます。 まず fdisk でディスク全体を Solaris 用に割り当てます。
# fdisk /dev/rdsk/c2d0p0


             Total disk size is 30400 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1       Active    Solaris2          1  30399    30399    100
format コマンドで Slice を設定。
# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1d0 
          /pci@0,0/pci-ide@7/ide@0/cmdk@0,0
       1. c2d0 
          /pci@0,0/pci-ide@7/ide@1/cmdk@0,0
Specify disk (enter its number): 1
selecting c2d0
Controller working list found
[disk formatted, defect list found]

partition> p
Current partition table (original):
Total disk cylinders available: 30397 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0                0         (0/0/0)             0
  1 unassigned    wm       0                0         (0/0/0)             0
  2     backup    wu       0 - 30396      232.85GB    (30397/0/0) 488327805
  3 unassigned    wm       0                0         (0/0/0)             0
  4 unassigned    wm       0                0         (0/0/0)             0
  5 unassigned    wm       0                0         (0/0/0)             0
  6 unassigned    wm       0                0         (0/0/0)             0
  7 unassigned    wm       0                0         (0/0/0)             0
  8       boot    wu       0 -     0        7.84MB    (1/0/0)         16065
  9 alternates    wm       1 -     2       15.69MB    (2/0/0)         32130
c2d0s2 を newfs してみました。
# newfs /dev/rdsk/c2d0s2
newfs: 新しいファイルシステム /dev/rdsk/c2d0s2 を作成しますか: (y/n)? y
警告: 最終シリンダで 3460 セクタが割り当てられません。
/dev/rdsk/c2d0s2:       全セクター数: 488327804  (シリンダ数: 79481、トラック数: 48、セクター数: 128)
        238441.3MB、4968 シリンダグループ (16 c/g, 48.00MB/g, 5824 i/g)
スーパーブロックのバックアップの位置 (fsck -F ufs -o b=# のため) :
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
シリンダグループの初期化:
...............................................................................
....................
スーパーブロックのバックアップの位置 (最後の 10 シリンダグループのため):
 487395104, 487493536, 487591968, 487690400, 487788832, 487887264, 487985696,
 488084128, 488182560, 488280992
この状態で MBR, Partition 1 を書き込んで fdisk で確認 したところ元に戻っている様子。
# dd of=/dev/rdsk/c2d0p0 if=/var/tmp/mbr.dat count=1
書き込まれたレコード数 1+0
読み出されたレコード数 1+0
# dd of=/dev/rdsk/c2d0p1 if=/var/tmp/c2d0p1.dat bs=1024k
書き込まれたレコード数 8095+1
読み出されたレコード数 8095+1
# fdisk /dev/rdsk/c2d0p0
             Total disk size is 30400 cylinders
             Cylinder size is 16065 (512 byte) blocks

                                               Cylinders
      Partition   Status    Type          Start   End   Length    %
      =========   ======    ============  =====   ===   ======   ===
          1       Active    IFS: NTFS         0  1031    1032      3
この状態でリストアしたディスクで起動確認したところ 無事 Windows Server 2003 が起動してきました。 X86 系の場合は、この手法が使えそうです。 間違い等あればご指摘ください。 それでは。

7月 21日 2006年, 01:00:00 午前 JST Permalink 投稿されたコメント [0]

Trackback URL: http://blogs.sun.com/akashi/entry/lan_free_backup_2
投稿されたコメント:

コメント

名前
メール
URL

投稿されたコメント

HTML文法 不許可