今日は自由帳と学童の連絡帳を忘れて帰ってきましたよ。
毎日何かを忘れて帰ってくるね。
明日から授業だそうです。
毎日何かを忘れて帰ってくるね。
明日から授業だそうです。
label: fictitiousというコメントをいただいたので試してみました。
っていう行が(これは良きにはからったものだよ)という意味になっているかどうか、つまり本当に、「良きにはからった時」だけに表示されるかが気になるのですが、自分では実はまだ確めたことがないのです。
eeepc# fdisk sd1 fdisk: primary partition table invalid, no magic in sector 0 fdisk: Cannot determine the number of heads Disk: /dev/rsd1d NetBSD disklabel disk geometry: cylinders: 31, heads: 64, sectors/track: 32 (2048 sectors/cylinder) total sectors: 64000 BIOS disk geometry: cylinders: 31, heads: 64, sectors/track: 32 (2048 sectors/cylinder) total sectors: 64000 Partition table: 0: <UNUSED> 1: <UNUSED> 2: <UNUSED> 3: <UNUSED> Bootselector disabled. No active partition. eeepc#
eeepc# disklabel -r sd1 disklabel: could not read existing label eeepc#たしかにon-diskなラベルはありませんね。では、in-coreラベルを作ってもらい、それを表示してもらいましょう。
eeepc# disklabel sd1 # /dev/rsd1d: type: SCSI disk: ClipDrive label: fictitious flags: removable bytes/sector: 512 sectors/track: 32 tracks/cylinder: 64 sectors/cylinder: 2048 cylinders: 31 total sectors: 64000 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 4 partitions: # size offset fstype [fsize bsize cpg/sgs] a: 64000 0 4.2BSD 0 0 0 # (Cyl. 0 - 31*) d: 64000 0 unused 0 0 # (Cyl. 0 - 31*) disklabel: boot block size 0 disklabel: super block size 0 eeepc#おぉ、labelにfictitiousが表示されてます。
eeepc# disklabel -i -I sd1 partition> P 4 partitions: # size offset fstype [fsize bsize cpg/sgs] a: 64000 0 4.2BSD 0 0 0 # (Cyl. 0 - 31*) d: 64000 0 unused 0 0 # (Cyl. 0 - 31*) partition> W Label disk [n]? y Label written partition> Q eeepc#
eeepc# disklabel -r sd1 # /dev/rsd1d: type: SCSI disk: ClipDrive label: fictitious flags: removable bytes/sector: 512 sectors/track: 32 tracks/cylinder: 64 sectors/cylinder: 2048 cylinders: 31 total sectors: 64000 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 4 partitions: # size offset fstype [fsize bsize cpg/sgs] a: 64000 0 4.2BSD 0 0 0 # (Cyl. 0 - 31*) d: 64000 0 unused 0 0 # (Cyl. 0 - 31*) eeepc#あれ? on-diskラベルでもfictitiousって表示されます。
1: makoto fujiwara 『その文字をそのままにしておくと、書いてしまう、なんて思っても見ませんでした。良く分りましたね。すごい。というか書くときに fic...』 (2008/04/09 16:25)
Disk: /dev/rsd1d NetBSD disklabel disk geometry: cylinders: 15326, heads: 64, sectors/track: 32 (2048 sectors/cylinder) total sectors: 31388672 BIOS disk geometry: cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder) total sectors: 31388672 Partition table: 0: Primary DOS with 32 bit FAT - LBA (sysid 12) start 8192, size 31380480 (15323 MB, Cyls 0/130/3-1953/217/56) 1: <UNUSED> 2: <UNUSED> 3: <UNUSED> No active partition.で、disklabel sd1の結果はこんな感じ。
# /dev/rsd1d: type: SCSI disk: USB SD Reader label: fictitious flags: removable bytes/sector: 512 sectors/track: 32 tracks/cylinder: 64 sectors/cylinder: 2048 cylinders: 15326 total sectors: 31388672 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # microseconds track-to-track seek: 0 # microseconds drivedata: 0 5 partitions: # size offset fstype [fsize bsize cpg/sgs] d: 31388672 0 unused 0 0 # (Cyl. 0 - 15326*) e: 31380480 8192 MSDOS # (Cyl. 4 - 15326*)つまり、fdiskでMS-DOSのパーティションが切ってあって、disklabelでそれが反映された格好になっているわけですね。
# dd if=/dev/zero of=/dev/rsd1d bs=512k count=100てな感じで、マスターブートレコード (MBR) はもちろん、NetBSDパーティションの先頭もつぶしたつもりになっていました。なにしろ50MBほどゼロでつぶしたので、間違いないだろうと。
On systems that expect to have disks with MBR partitions (see fdisk(8)) disklabel will find, and update if requested, labels in the first 8k of type 169 (NetBSD) MBR labels and within the first 8k of the physical disk. On other systems disklabel will only look at the start of the disk. The offset at which the labels are written is also system dependent.これは、i386のようなMBRがあるようなシステムでは、disklabelはNetBSDパーティションの先頭8kか物理ディスクの先頭8kを探しますってことで、つまりディスクの先頭かパーティションの先頭にラベルが書かれるわけですよね。
# /dev/rsd1d: type: SCSI 中略 4 partitions: # size offset fstype [fsize bsize cpg/sgs] a: 31388672 0 4.2BSD 0 0 0 # (Cyl. 0 - 15326*) d: 31388672 0 unused 0 0 # (Cyl. 0 - 15326*) disklabel: boot block size 0 disklabel: super block size 0という感じであってますかね?