2014年8月18日月曜日

grub4dos 簡単インスト linuxマウント

 boot openbsd by puppy's grub4dos


HDDにまずopenbsdをいれます。
それからpuppyをいれました。

puppyで fdiskをすると

# fdisk /dev/sda
Command (m for help): p

Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0008579c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    10487807     5242880   83  Linux
/dev/sda2        10487808    55830527    22671360   83  Linux
/dev/sda3        55830528    78140159    11154816   a6  OpenBSD

となってます。

/dev/sda1 に puppyがいて
/dev/sda2 は ext2 ファイルシステムで ここはpuppyからもopenbsdからも読み書きをできるようにしていきます。


puppy はgrub4dosで openbsdを起動するのですが、
そのファイルは
sda1にある menu.lst で以下で

title OpenBSD
      chainloader (hd0,2)+1
      rootnoverify (hd0,2)
        boot


難所はopenbsdで /dev/sda2 (ext2)を読み書きできるようにすることです。
まず普通に
すると

# disklabel wd0
 #                size           offset  fstype [fsize bsize  cpg]
  a:         19426368         56886176  4.2BSD   2048 16384    1 # /
  b:          1055637         55830528    swap                   # none
  c:         78140160                0  unused                   

だけで、 ext2 がでてきません。

つまり openbsdは後からいれた ext2を認識してません。
それには disklabel -e
で編集する作業が必要になります。

まず fdisk wd0      をして
            
Disk: wd0       geometry: 4864/255/63 [78140160 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*0: 83      0  32  33 -    652 213   9 [        2048:    10485760    ]   Linux files*
 1: 83    652 213  10 -   3475  73  54 [    10487808:    45342720  ] Linux files*
 2: A6   3475  73  55 -   4863 254  63 [    55830528:    22309632  ] OpenBSD   
 3: 00      0   0   0 -      0   0   0 [           0:           0 ] unused  
なので 

10487808:    45342720 
とを覚えておきます。

それから
disklabel -e wd0 すると viによる編集モードに入ります。

そこで
# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: TOSHIBA MK4032GA
duid: 4ad4d11d7894f655
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 4864
total sectors: 78140160
boundstart: 55830528
boundend: 78140160
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:         19426368         56886176  4.2BSD   2048 16384    1 # /
  b:          1055637         55830528    swap                   # none
  c:         78140160                0  unused
  o:         45342720         10487808  ext2fs



とします。
すると

 mount_ext2fs /dev/wd0o /EXT2
でマウントできます。

 あるいは
 cat /etc/fstab                                                              
4ad4d11d7894f655.b none swap sw
4ad4d11d7894f655.a /           ffs       rw 1 1
/dev/wd0o                 /EXT2/  ext2fs rw 1 1

でも可





しては いけないこと fdisk -i sd0
こうすると sd0全体が openbsd王国になってしまう。

これをやっちゃうと 
  fdisk -e sd0 ->edit 0
の後
 mkfs.ext2もできる。
もっとも フォーマットは大変遅いけどね。
 




openbsdは 最近は xfceもいれず そのままの形でつかってます。

export PKG_PATH=http://ftp.jaist.ac.jp/pub/OpenBSD/5.6/packages/i386



そのためにxtermが大事で
$ cat .Xdefaults                                                              

XTerm*faceName:'Monospace'
XTerm*faceSize:13
XTerm*background:gray
XTerm*foreground:black

すると見やすくなります


 /root/.profile の最後に
export PKG_PATH=http://ftp.jaist.ac.jp/pub/OpenBSD/5.5/packages/i386/

this line is not so useful .
some times paste this to terminal


/etc/rc.conf.local                                                             
# xdm_flags=            # enabled during install
dhcpd_flags=""  #NO             # for normal use: ""

portmap_flags=""
mountd_flags=""
nfsd_flags="-tun 4"

ntpd_flags=""   #NO             # for normal use: ""



/etc/exports                                                                   
/RW  -alldirs -maproot=tuyosi -network=192.168.11 -mask=255.255.255.0


exit

 .xsessionは                                                               
export GTK_IM_MODULE="ibus"
export QT_IM_MODULE="ibus"
export XMODIFIERS="@im=ibus"
/usr/local/bin/ibus-daemon -d -x -r
   #export LC_CTYPE=en_US.UTF-8
export LC_CTYPE=ja_JP.UTF-8  

export LANG=ja_JP.UTF-8         # この行をいれるとjp106が安定かな?







  pkg_add    firefox   firefox-i18n-ja
すると
 To configure Firefox for your language, go to add-ons language
management
(Tools->Add-ons->Languages), click 'activate' on your
installed language, type
"about:config" in the URL-bar and edit
"general.useragent.locale" (e.g. fr-FR  ja-JP ; default is en-US), then
restart Firefox.



$ cat firefox.bat                                                             
firefox &
kill ` ps ax | grep ibus-daemon | grep -v grep  | cut -d ' ' -f 1 `
/usr/local/bin/ibus-daemon -d -x -r &
echo ' ps ax | grep ibus-daemon '



 pkg_add nano   lftp ibus  anthy    ibus-anthy   ja-mplus-ttf 





  # cat /etc/dhcpd.interfaces 
ne3






# cat /etc/dhcpd.conf      
option  domain-name-servers 192.168.1.1;
subnet 192.168.11.0 netmask 255.255.255.0 {
       option routers 192.168.11.1;
        range 192.168.11.3 192.168.11.7;
}







# cat /etc/pf.conf                                                            



# macros
int_if="ne3"
ext_if="sis0"
tcp_services="{ 22, 113 }"
icmp_types="echoreq"

# options
set block-policy return
set loginterface egress
set skip on lo


# match rules
match out on $ext_if inet from !($ext_if:network) to any nat-to ($ext_if:0)


# filter rules
block in log
pass out quick
antispoof quick for { lo $int_if }
pass in  on  $ext_if   inet proto tcp from any to  ( $ext_if:0 ) port  $tcp_services
pass in inet proto icmp all icmp-type $icmp_types
pass in on $int_if




# pkg_info | grep tools                                                       
pkg_add  cdrtools   dvd+rw-tools cdio


CDでは
# cdio -f cd1c blank  ; eject /dev/rcd1c
You are now ready to burn the image created in the above example to a blank CD-R(W). You could use a command similar to:
# cdio -f cd1c tao sys.iso
With the options specified above, we're asking cdio to use the second CD-ROM device as the CD writer. To verify whether the CD-ROM has been written correctly, you can mount it and check whether everything is there. To mount the filesystem, you should use the block device for the CD-ROM drive, which in this case is still the CD writer:
# mount /dev/cd1c /mnt/cdrom

 
cat dvd-rw-BLANK.bat
dvd+rw-format -force /dev/rcd0c ; eject  /dev/rcd0c



dd if=/dev/rsd0c とか

ワープロ代わりに seamonkey 

ペイントで          xpaint

画面キャプチャ     scrot -d 10 -c -u

lame  ,   toolame

scp -r $1  tysi@192.168.11.1:some_dir

 
時間合わせ  ntpd -s


DVDでは
      growisofs -dvd-compat -Z /dev/dvd=image.iso


ext2のmount
# disklabel sd0                                                                     


# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: TOSHIBA MK8046GS
duid: 0000000000000000
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 9729
total sectors: 156301488
boundstart: 0
boundend: 156301488
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:        156301488                0  unused                  
  i:        136718750             2048  ext2fs                  
  j:         18554464        136720798   MSDOS                  
  k:          1026048        155275264 unknown   



^^^^^^^^^^^^^^^^^^^^^^^^^^^

 mount_msdos   /dev/sd0j    /mnt


http://alokat.org/blog/2013/02/12/update-to-the-latest-openbsd-snapshot/
 
mkdir /cdrom
mount /dev/cd0c /cdrom 
cd /cdrom/5.6/amd64

OpenBSD provides a tool called sysmerge to merge the config files with those of the snapshot.




sysmerge -s etc56.tgz  -x xetc56.tgz  -S
 


















1
pkg_add -u

 
openbsd
dhcp  の場合  /etc/mygate がない
         cat /etc/hostname.fxp0 ー≫dhcp
 
staticの場合  cat /etc/mygate ー≫ 192.168.11.1
        cat /etc/hostname.fxp0 ー≫inet 192.168.11.11  255.255.255.0  192.168.11.255


/etc/fstab でext2fsすると HDDの構成が変わったときに 下手すると
再インストールになる可能性がある

cat /etc/rc.local
if [  -x  /root/mount-EXT2.bat ]; then
        echo 'Starting mount /EXT2 '; /root/mount-EXT2.bat
fi



cat  /root/mount-EXT2.bat
umount  /EXT2
mount_ext2fs  /dev/wd2i   /EXT2




slackoは opensshをいれないと
ssh: connection to tuyosi@192.168.11.11:22 exited: no matching algo kex
となる。


cat comment-out.bat
 awk '$1 !~ "#"{print}' $1 | awk 'NF >0 {print}' -




0 件のコメント:

コメントを投稿