[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mount_msdos



	大変古い記事に対するこめんとですが、MS-DOS onlyのハードディスクの
	mountについて。
	http://www.jp.netbsd.org/ja/JP/ml/port-hpcmips-ja/200008/msg00220.html

	BSD/OSでいつもやっているのは、
	「raw device経由でfdisk table呼んでkernel disklabelをioctlで書き
	換える」ユーザプログラムを一個作っておいて、mount前に実行する、です。
	とっても簡単。fakelabel(8)。

itojun


---
FAKELABEL(8)              BSD System Manager's Manual             FAKELABEL(8)

NAME
     fakelabel - create 'faked' disklabel for DOS-dedicated disk.

SYNOPSIS
     fakelabel [-u] [-v] [disk]

DESCRIPTION
     BSD/OS uses disklabel data structure in the BSD partition.  Therefore, it
     have not been possible to mount hard drives without BSD partition.
     fakelabel creates fake disklabel for target raw-disk into the kernel
     workarea, and makes it possible to mount DOS-only hard drives from
     BSD/OS.  This program is originally created for reading/writing DOS-for-
     matted SunDisk (PCMCIA solid state IDE disk) for HP-200LX or similar
     products.  It should be useful for non-removable hard drives too.  The
     options are as follows:

     -u      Update.  With this option, fakelabel actually updates the kernel
             workarea.  The program will NOT update kernel workarea without
             this option, therefore it's safe to do so.

     -v      Verbose. Output some more diagnostics.

     disk    Target hard drive to work on.  It should be specified like
             "/dev/rwd2c" or "wd2."  There's very few sanity checks implement-
             ed.  Be warned.

HOW TO USE
     First, connect an IDE harddisk to the CPU, and login as root.  (we assume
     the IDE harddisk is on wd2, throughout this description)

     Try "disklabel wd2."  Since we have no disklabel structure on the disk,
     the kernel yells warning message.

     Pray for 3 seconds, and execute "fakelabel -u wd2."

     Try "disklabel wd2" again.  You'll see fake disklabel in the kernel memo-
     ry.  Double-check the disklabel is good for your harddisk.  If it does
     not fit yours, then stop using this utility.

     By doing "mount -t msdos /dev/wd2d /a," you can read/write the harddisk.
     Don't forget to unmount it.

CAUTION
     This software is DANGEROUS. USE AT YOUR OWN RISK.  BACKUP YOUR FILES BE-
     FORE TRY IT.  The authors assume no responsibility on the result of the
     execution.

REDISTRIBUTION
     Freely redistributable.  If you are going to redistribute modified ver-
     sion, you MUST redistribute that with source-code.

AUTHOR
     Jun-ichiro "itojun" Itoh <itojun@mt.cs.keio.ac.jp>

                                 June 15, 1995                               1