大...@元記事です。

From: Hirohito <m...@youko-house.ne.jp>
Message-ID: <4b717ed8.4060...@youko-house.ne.jp>

> 私は、ATA/SATA to USB アダプタを、4種類ほど使った経験がありますが、
> 挙動や安定性にばらつきがあるように感じます。
> 
> アダプタを買い換えてみるか、もしくはアダプタを使わずにディスクを接続して
> 試してみてはいかがでしょうか。

設置環境上ケースを開けるのが面倒だったので避けていたのですが,
御指摘に従ってSATA直結で試してみました。


# fdisk /dev/ad4
******* Working on device /dev/ad4 *******
parameters extracted from in-core disklabel are:
cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953525105 (953869 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 612/ head 15/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
# fdisk -BI /dev/ad4
******* Working on device /dev/ad4 *******
fdisk: Geom not found: "ad4"
# fdisk /dev/ad4
******* Working on device /dev/ad4 *******
parameters extracted from in-core disklabel are:
cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953525105 (953869 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 612/ head 15/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
# cat var/bsdlabel.txt
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:  4194304        0    4.2BSD     2048 16384 28528 
  b: 16777216  4194304      swap                    
  c: 1953525105       0    unused        0     0         # "raw" part, don't 
edit
  d: 16777216 20971520    4.2BSD     2048 16384 28528 
  e: 16777216 37748736    4.2BSD     2048 16384 28528 
  f: 67108864 54525952    4.2BSD     2048 16384 28528 
  g: 67108864 121634816   4.2BSD     2048 16384 28528 
  h: 1764781425 188743680    4.2BSD     2048 16384 28528 
# bsdlabel -w -B /dev/ad4s1
# bsdlabel -R -B /dev/ad4s1 var/bsdlabel.txt
# bsdlabel /dev/ad4s1
# /dev/ad4s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:  4194304        0    4.2BSD     2048 16384 28528 
  b: 16777216  4194304      swap                    
  c: 1953525105        0    unused        0     0         # "raw" part, don't 
edit
  d: 16777216 20971520    4.2BSD     2048 16384 28528 
  e: 16777216 37748736    4.2BSD     2048 16384 28528 
  f: 67108864 54525952    4.2BSD     2048 16384 28528 
  g: 67108864 121634816    4.2BSD     2048 16384 28528 
  h: 1764781425 188743680    4.2BSD     2048 16384 28528 
# newfs -U /dev/ad4s1a
/dev/ad4s1a: 2048.0MB (4194304 sectors) block size 16384, fragment size 2048
        using 12 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
 160, 376416, 752672, 1128928, 1505184, 1881440, 2257696, 2633952, 3010208,
 3386464, 3762720, 4138976
# newfs -U /dev/ad4s1d
/dev/ad4s1d: 8192.0MB (16777216 sectors) block size 16384, fragment size 2048
        using 45 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
(snip)
# newfs -U /dev/ad4s1e
/dev/ad4s1e: 8192.0MB (16777216 sectors) block size 16384, fragment size 2048
        using 45 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
(snip)
# newfs -U /dev/ad4s1f
/dev/ad4s1f: 32768.0MB (67108864 sectors) block size 16384, fragment size 2048
        using 179 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
(snip)
# newfs -U /dev/ad4s1g
/dev/ad4s1g: 32768.0MB (67108864 sectors) block size 16384, fragment size 2048
        using 179 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
(snip)
# newfs -U /dev/ad4s1h
/dev/ad4s1h: 861709.7MB (1764781424 sectors) block size 16384, fragment size 
2048
        using 4691 cylinder groups of 183.72MB, 11758 blks, 23552 inodes.
        with soft updates
super-block backups (for fsck -b #) at:
(snip)
# mount -t ufs /dev/ad4s1a /mnt
# df
Filesystem  512-blocks      Used    Avail Capacity  Mounted on
/dev/ad0s1a    2025948   1125024   738852    60%    /
devfs                2         2        0   100%    /dev
/dev/ad0s1h  334638772 288049272 19818400    94%    /home
/dev/ad0s1d    8116124   1168632  6298204    16%    /tmp
/dev/ad0s1g   48744920  20984600 23860728    47%    /usr
/dev/ad0s1e    8116124   6086928  1379908    82%    /var
/dev/ad0s1f   64989336  50150076  9640116    84%    /var/news
procfs               8         8        0   100%    /proc
linprocfs            8         8        0   100%    /usr/compat/linux/proc
/dev/ad4s1a    4052060         8  3727888     0%    /mnt
# umount /mnt
# mount -t ufs /dev/ad4s1h /mnt
# df
Filesystem  512-blocks      Used      Avail Capacity  Mounted on
/dev/ad0s1a    2025948   1125024     738852    60%    /
devfs                2         2          0   100%    /dev
/dev/ad0s1h  334638772 288049272   19818400    94%    /home
/dev/ad0s1d    8116124   1168632    6298204    16%    /tmp
/dev/ad0s1g   48744920  20984600   23860728    47%    /usr
/dev/ad0s1e    8116124   6086928    1379908    82%    /var
/dev/ad0s1f   64989336  50150076    9640116    84%    /var/news
procfs               8         8          0   100%    /proc
linprocfs            8         8          0   100%    /usr/compat/linux/proc
/dev/ad4s1h 1709239676         8 1572500496     0%    /mnt
# umount /mnt


……と, newfsまで正常にできました。
この後, USBで繋ぎ直してみましたが, mount・読み書きとも問題ありません。


# fdisk /dev/da0
******* Working on device /dev/da0 *******
parameters extracted from in-core disklabel are:
cylinders=121601 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=121601 heads=255 sectors/track=63 (16065 blks/cyl)

Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953525105 (953869 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 612/ head 15/ sector 63
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
# mount -t ufs /dev/da0s1a /mnt
# df
Filesystem  1K-blocks      Used    Avail Capacity  Mounted on
/dev/ad0s1a   1012974    562512   369426    60%    /
devfs               1         1        0   100%    /dev
/dev/ad0s1h 167319386 144024064  9909772    94%    /home
/dev/ad0s1d   4058062    584330  3149088    16%    /tmp
/dev/ad0s1g  24372460  10492310 11930354    47%    /usr
/dev/ad0s1e   4058062   3043584   689834    82%    /var
/dev/ad0s1f  32494668  25075038  4820058    84%    /var/news
procfs              4         4        0   100%    /proc
linprocfs           4         4        0   100%    /usr/compat/linux/proc
devfs               1         1        0   100%    /var/named/dev
/dev/da0s1a   2026030         4  1863944     0%    /mnt
# touch /mnt/test
# ls /mnt
.snap   test
# rm /mnt/test
# umount /mnt


fdiskで出力されるパラメータ(特にsize)が前回と変わっているのが
気になりますが, ハングアップの原因もこれでしょうか。

(前回:USB)
cylinders=121601 heads=255 sectors/track=63 (16065 blks/cyl)
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953520002 (953867 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 768/ head 254/ sector 63

(今回:SATA)
cylinders=1938021 heads=16 sectors/track=63 (1008 blks/cyl)
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953525105 (953869 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 612/ head 15/ sector 63

(今回:USB)
cylinders=121601 heads=255 sectors/track=63 (16065 blks/cyl)
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 1953525105 (953869 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 612/ head 15/ sector 63

何れにしても, エラーならともかくハングアップするというのは
勘弁して欲しいところです。


最後に, 御意見を下さった長谷川さん, 植村さん, ひろひとさん,
大変ありがとうございました。


-- 
大友紘之
oot...@za.wakwak.com

メールによる返信