2015年3月30日月曜日

linux で 作った openbsd  領域に 新規 インストール

linux で openbsd 領域をつくりました。


fdisk -l /dev/sdb
Device     Boot     Start       End   Sectors  Size Id Type
/dev/sdb1           22528   3891199   3868672  1.9G 82 Linux swap / Solaris
/dev/sdb2            2048     22527     20480   10M  c W95 FAT32 (LBA)
/dev/sdb3         3891200 842751999 838860800  400G  5 Extended
/dev/sdb4       842752000 976773167 134021168 63.9G a6 OpenBSD
/dev/sdb5         3893248 213608447 209715200  100G 83 Linux
/dev/sdb6  *    213610496 528183295 314572800  150G 83 Linux
/dev/sdb7       528185344 842751999 314566656  150G  7 HPFS/NTFS/exFAT



しかし
openbsdのCDで /dev/sdb4 へ直接インストールするのは
失敗した時恐ろしいことが待ち受けます。

それで作戦をかえ、まずUSBにインストールしてから
その内容を /dev/sdb4に クローンコピーする方向にしました。

2G のUSB と 500GのSDBとを接続後
openbsdのCDでブートします。

ctrl+c を押し、中断させ dmesgでどう認識されてるかを見ます。
500Gのは sd1と認識されてます。
2G のは   sd2。


install と打ち込み、
インストール先を OpenBSD areaとし、
sd1がフォーマットされる段階が終わったら ctrl+c 。


なお自分は a(/) と b(swap)しか作りません。


この後
# mkdir /mnt0
# mkdir /mnt1

# mount /dev/sd2a /mnt0  
# mount /dev/sd1a /mnt1
 
# (cd /mnt0; tar cvpf - .)|(cd /mnt1 ; tar xpf -)

これで クローンコピーは終了です。
しかし ブートローダーは入ってない。

そのため一旦 halt します。

2Gを抜き、 500Gだけつけて openbsd CDでブート.
今度は upgrade を選び、
bsd.rdなんたらのところにきたら
abort を選んだあと 
halt します。

あと 以前のようにgrub4dosで openbsdを立ち上げたあと、
/etc/rc.conf.local で xdmをコメントアウトします。

これで終了です。


以下は英語で同じものです。
this is my little expirience , it may be useful using openbsd & linux in
tha same hard disk .

I made the openbsd area by LINUX's fdisk.
namely
fdisk -l /dev/sdb (500GB USB hard disk)
Device Boot Start End Sectors Size Id Type
 sdb1 22528 3891199 3868672 1.9G 82 Linux swap / Solaris
 sdb2 2048 22527 20480 10M c W95 FAT32 (LBA)
 sdb3 3891200 842751999 838860800 400G 5 Extended
 sdb4 842752000 976773167 134021168 63.9G a6 OpenBSD <--------
 sdb5 3893248 213608447 209715200 100G 83 Linux
 sdb6 * 213610496 528183295 314572800 150G 83 Linux
 sdb7 528185344 842751999 314566656 150G 7 HPFS / NTFS / exFAT


i want to install openbsd OS into sdb4 .
But to install OpenBSD directly is risky .
if i fail , i lose all (including linux) .

So I changed the strategy.
install first on 2G USB.
then clone copy to 500G USB sdb4 .


After connecting the 2G USB and 500G USB , I boot by  openbsd CD .
press ctrl + c, I  look at the way of 2G and 500G by 'dmesg' .
500G is  recognized as sd1.
2G                  as sd2.

i install openbsd OS into ---OpenBSD area---.
When sd1 is formatted , i put  ctrl + c.

my way is always  a (/) and b (swap) only .
so

# mkdir / mnt0
# mkdir / mnt1

# Mount /dev/sd2a / mnt0
# Mount /dev/sd1a / mnt1

# (cd / mnt0;. tar cvpf -) | (cd / mnt1; tar xpf -)

clone copy itself is completed.
But the boot loader is not .


Therefore I will install boot loader .
afte unplug the 2G, put 500G only ,then i  boot by openbsd CD.
Now select the ---upgrade---,
When i came to the stage 'bsd.rd etc', i select ---abort---.

all is done .
by using  previos menu.lst , i boot openbsd in 500G by grub4dos .
After i launched openbsd , I comment out the xdm in /etc/rc.conf.local.