Eu tenho uma máquina antiga do FreeBSD rodando em uma plataforma baseada em x86 com particionamento MBR abaixo
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
Eu atualizo a caixa para o FreeBSD para 10.1 (a partição do nextroot é para atualização).
Como o kernel não tem suporte para ext2 enable eu substituo / boot / kernel / kernel com um kernel do FreeBSD com o suporte ao ext2 enable.
Poste essa tentativa de formatar uma partição, pois o ext2 está falhando:
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) Confirmei que o HDD é bom. Se eu formatar o disco rígido com o particionamento GPT, não enfrentarei nenhum problema na formatação.
Minha pergunta: Eu preciso de mais alguma coisa para ser habilitado no kernel do FreeBSD para a criação de partições ext2 ao usar o particionamento MBR?
Observação: vejo abaixo a mensagem no 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]
Eu não vejo 'GEOM: mfid0s1a: disklabel inválido' ao formatar uma partição como UFS. Existe alguma boa explicação para isso?
Editar:
Recebi a seguinte resposta do mantenedor do utilitário ext2fs. Alguém pode me ajudar a decifrá-lo? Não tem muita ideia sobre geom ou 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).
O kernel do BSD tem a seguinte opção ativada:
# 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
Mais alguns registros:
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]