다음 MBR 파티션이 있는 x86 기반 플랫폼에서 실행되는 오래된 FreeBSD 시스템이 있습니다.
pod0226-wsa115:rtestuser 1] uname -a
FreeBSD pod0226-wsa115 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Mon Mar 10 15:25:29 PDT 2014 [email protected]:/usr/build/iproot/freebsd/mods/src/sys/amd64/compile/MESSAGING_GATEWAY.amd64 amd64
pod0226-wsa115:rtestuser 2] df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/mfid0s1a 1.9G 356M 1.4G 20% /
devfs 1.0K 1.0K 0B 100% /dev
/dev/mfid0s1d 1.9G 2.0K 1.7G 0% /nextroot
/dev/mfid0s1e 374M 112K 344M 0% /var
/dev/mfid0s1g 789G 45G 681G 6% /data
/dev/mfid0s1h 1.9G 31K 1.8G 0% /var/db/godspeed
procfs 4.0K 4.0K 0B 100% /proc
linprocfs 4.0K 4.0K 0B 100% /compat/linux/proc
linsysfs 4.0K 4.0K 0
FreeBSD를 10.1로 업그레이드했습니다(업그레이드에는 다음 루트 파티션이 사용되었습니다). 커널은 ext2 활성화를 지원하지 않기 때문에 /boot/kernel/kernel을 ext2 지원이 활성화된 FreeBSD 커널로 교체했습니다.
파티션을 ext2로 포맷하려는 시도에 실패한 게시물:
pod0226-wsa115:rtestuser 2] umount /dev/mfid0s1a
pod0226-wsa115:rtestuser 3] mke2fs /dev/mfid0s1a -------------------------------------formatting nextroot
mke2fs 1.42.10 (18-May-2014)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 7d23f5c1-1a72-4044-b167-26957605f4fd
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
**Warning: could not erase sector 0: Attempt to write block to filesystem resulted in short write**
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
a) 하드 드라이브가 양호한 것을 확인했습니다. GPT 파티션을 사용하여 HDD를 포맷하면 포맷하는 동안 아무런 문제가 발생하지 않습니다.
내 질문: MBR 파티션을 사용할 때 ext2 파티션을 생성하려면 FreeBSD 커널의 다른 항목을 활성화해야 합니까?
관찰: dmesg에 다음 메시지가 표시됩니다.
ip_dn_ctl dummynet: compat option 62
GEOM: mfid0s1a: invalid disklabel.
GEOM: ufsid/59ab725d8197dcee: invalid disklabel.
GEOM: mfid0s1a: invalid disklabel. ------------> first try
GEOM: mfid0s1a: invalid disklabel. ------------> second try
pod0226-wsa115:rtestuser 12]
파티션을 UFS로 포맷할 때 "GEOM: mfid0s1a: 잘못된 디스크 레이블"이 표시되지 않습니다. 이에 대한 좋은 설명이 있습니까?
편집하다:
ext2fs 유틸리티 관리자로부터 다음과 같은 응답을 받았습니다. 누군가 내가 이것을 해독하도록 도와줄 수 있나요? geom이나 BSDDISKLABELS에 대해 잘 모릅니다.
You can't freely write to bootblocks or other "Rank 1 geom providers",
https://www.freebsd.org/cgi/man.cgi?geom(4) - look for "debugflags".
You should not use ext2 on BSD partitions, but use it only on slices for
compatibility (which can then obviously not have BSD partitions).
BSD 커널에는 다음 옵션이 활성화되어 있습니다:
# 2 fibs.
options ROUTETABLES=2
device ichgpio
options GEOM_BSD
options GEOM_LABEL # Provides labelization
options GEOM_ELI
# The following breaks DIOCGDINFO
options GEOM_PART_GPT # GUID Partition Tables.
options GEOM_MBR
추가 로그:
pod0226-wsa115:rtestuser 15] gpart show -l
=> 63 2339839937 mfid0 MBR (1.1T)
63 2339839908 1 (null) [active] (1.1T)
2339839971 29 - free - (15K)
=> 0 2339839908 mfid0s1c BSD (1.1T)
0 4194304 1 (null) (2.0G)
4194304 16777216 2 (null) (8.0G)
20971520 4194304 4 (null) (2.0G)
25165824 819200 5 (null) (400M)
25985024 629145600 6 (null) (300G)
655130624 1680514980 7 (null) (801G)
2335645604 4194304 8 (null) (2.0G)
pod0226-wsa115:rtestuser 16]
pod0226-wsa115:rtestuser 14] disklabel /dev/mfid0s1d -----------> ufs partition
disklabel: /dev/mfid0s1d: no valid label found
pod0226-wsa115:rtestuser 15]
pod0226-wsa115:rtestuser 8] mkfs.ext2 /dev/mfid0s1a ------> UFs partition unmounted and reformated as ext2
mke2fs 1.42.10 (18-May-2014)
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: c086c5ca-d2d4-4634-84b0-1c2d638feb28
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912
Allocating group tables: done
Warning: could not erase sector 0: Attempt to write block to filesystem resulted in short write
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
pod0226-wsa115:rtestuser 9] dumpfs /dev/mfid0s1a
dumpfs: /dev/mfid0s1a: could not read superblock to fill out disk ------------------->
pod0226-wsa115:rtestuser 10] dumpfs /dev/mfid0s1d -------------------->UFS partition
magic 19540119 (UFS2) time Thu Sep 7 16:30:02 2017
superblock location 65536 id [ 59b1531e d697a7fb ]
ncg 4 size 262144 blocks 253839
bsize 65536 shift 16 mask 0xffff0000
fsize 8192 shift 13 mask 0xffffe000
frag 8 shift 3 fsbtodb 4
minfree 8% optim time symlinklen 120
maxbsize 65536 maxbpg 8192 maxcontig 2 contigsumsize 2
nbfree 19937 ndir 1562 nifree 244191 nffree 142
bpg 8193 fpg 65544 ipg 65792 unrefs 0
nindir 8192 inopb 256 maxfilesize 36033195603132415
sbsize 8192 cgsize 24576 csaddr 2088 cssize 8192
sblkno 16 cblkno 24 iblkno 32 dblkno 2088
cgrotor 0 fmod 0 ronly 0 clean 0
metaspace 0 avgfpdir 64 avgfilesize 16384
flags none
fsmnt /nextroot
volname swuid 0 providersize 0
cs[].cs_(nbfree,ndir,nifree,nffree):
(6340,516,61381,25) (7154,24,65425,13) (3289,230,62198,21) (3154,792,55187,83)
blocks in last group 8189
cg 0:
magic 90255 tell 30000 time Thu Sep 7 16:29:32 2017
cgx 0 ndblk 65544 niblk 65792 initiblk 4864 unrefs 0
nbfree 6340 ndir 516 nifree 61381 nffree 25
rotor 14816 irotor 4333 frotor 14512
frsum 4 3 0 1 1 1 0
sum of frsum: 25
clusters 1-1: 1
clusters size 2 and over: 2
clusters free: 1816, 1853-1865, 1867-8192
inodes used: 0-4332, 4334-4352, 4355-4366, 4368-4375, 4378, 4380-4412,
4421-4422, 4424-4426
blks free: 14518-14519, 14528-14535, 14560-14565, 14747-14751, 14758, 14798-14800,
14804, 14807, 14814-14819, 14824-14927, 14936-65543
cg 1:
magic 90255 tell 20040000 time Thu Sep 7 16:30:01 2017
cgx 1 ndblk 65544 niblk 65792 initiblk 768 unrefs 0
nbfree 7154 ndir 24 nifree 65425 nffree 13
rotor 8224 irotor 262 frotor 8088
frsum 2 2 1 1 0 0 0
sum of frsum: 13
clusters 1-1: 1
clusters size 2 and over: 1
clusters free: 0, 1040-8192
inodes used: 0-261, 263-367
blks free: 0-7, 7718, 8111, 8125-8127, 8140-8143, 8222-8223,
8302-8303, 8320-65543
cg 2:
magic 90255 tell 40050000 time Thu Sep 7 16:28:52 2017
cgx 2 ndblk 65544 niblk 65792 initiblk 4096 unrefs 0
nbfree 3289 ndir 230 nifree 62198 nffree 21
rotor 39256 irotor 3576 frotor 39224
frsum 2 1 0 1 0 1 1
sum of frsum: 21
clusters 1-1: 1
clusters size 2 and over: 2
clusters free: 0, 4870-4876, 4912-8192
inodes used: 0-3575, 3580-3597
blks free: 0-7, 38864-38867, 38952-38958, 38960-39021, 39223, 39231,
39294-65543
cg 3:
magic 90255 tell 60060000 time Thu Sep 7 16:29:32 2017
cgx 3 ndblk 65512 niblk 65792 initiblk 11008 unrefs 0
nbfree 3154 ndir 792 nifree 55187 nffree 83
rotor 40280 irotor 10485 frotor 33472
frsum 5 1 7 11 1 1 0
sum of frsum: 83
clusters 1-1: 1
clusters size 2 and over: 1
clusters free: 0, 5036-8188
inodes used: 0-10484, 10489-10491, 10493-10497, 10500-10502, 10504-10513, 10517-10582,
10587-10619
blks free: 0-7, 32848-32850, 32856-32861, 32883, 32905-32907, 40109-40111,
40127, 40135, 40143, 40151, 40157-40159, 40164-40167,
40172-40175, 40180-40183, 40188-40191, 40196-40199, 40205-40207, 40212-40215,
40220-40223, 40227-40231, 40237-40239, 40244-40247, 40252-40255, 40261-40263,
40268-40271, 40278-40279, 40284-65511
pod0226-wsa115:rtestuser 11]
답변1
첫째, 커널을 ext2를 지원하는 커널로 교체할 필요는 없습니다. 커널 모듈은 제대로 작동합니다. 모듈을 로드하지 않고 "mount -t ext2fs"를 수행하면 자동으로 로드됩니다.
둘째, 문제는 bsdlabel 파티션 테이블입니다... 이상합니다. 해당 "(null)" 항목은 거기에 있어서는 안 됩니다. "잘못된 디스크 레이블" 메시지도 이를 나타냅니다. 비교하려고:
[trasz@v2:~]% gpart show
=> 63 314572737 ada0 MBR (150G)
63 1 - free - (512B)
64 314572736 1 freebsd [active] (150G)
=> 0 314572736 ada0s1 BSD (150G)
0 314572736 1 freebsd-ufs (150G)
BSD 디스크 레이블을 파괴하고 다시 만들 수 있습니까?