O sistema de arquivos ext2 do FreeBSD é compatível com a implementação do Linux ext2?

0

Eu tenho uma caixa x86 executando o freeBSD 10.1. Eu estou agora a inicialização dupla com o Wind River Linux. Eu tinha duas partições sobressalentes que estou formatando no BSD como ext2. De um eu estou inicializando o Linux. Outros eu irei montar como ext2 no BSD e no Linux.

A formatação para ext2 de ambas as partições no BSD é limpa. Eu sou capaz de montá-los e criar / excluir arquivos também.

Mas quando inicializo no Linux, não consigo montar outra partição não-os como ext2. Se eu criar uma partição ext2 novamente nesta partição, a montagem de formatação estará limpa. Então, parece que a partição é utilizável apenas quando o formato no sistema operacional que eu estou montando.

Apenas curioso sobre qual poderia ser a razão por trás de tal comportamento.

No BSD, estou usando particionamento MBR com BDSDISKlabels. Eu tenho 8 partição.

Logs laterais do BSD:

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 31] cat /etc/fstab 
# $Header: //prod/coeus-8-0-0-br/wsa/freebsd/install/stage/etc/fstabs/single.mfid0#1 $
# Device     Mountpoint           FStype  Options  Dump  Pass#
/dev/mfid0s1d  /                    ufs     rw       1     1 ----> BSD OS
/dev/mfid0s1b  none                 swap    sw       0     0
/dev/mfid0s1a  /nextroot            ufs     rw       2     2 ----> Linux OS
/dev/mfid0s1e  /var                 ufs     rw       2     2
/dev/mfid0s1g  /data                ufs     rw       2     2
/dev/mfid0s1h  /var/db/godspeed     ufs     rw,sync  2     2
proc           /proc                procfs  rw       0     0
linproc        /compat/linux/proc   linprocfs rw     0     0
linsys         /compat/linux/sys    linsysfs  rw     0     0
pod0226-wsa115:rtestuser 32]

Usando desmontado / dev / mfid0s1f como ext2.

pod0226-wsa115:rtestuser 3] mke2fs /dev/mfid0s1f
mke2fs 1.42.10 (18-May-2014)
Creating filesystem with 78643200 4k blocks and 19660800 inodes
Filesystem UUID: 67034fd7-02ce-4463-b886-e173a6beb136
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done     

pod0226-wsa115:rtestuser 4] mke2fs /dev/mfid0s1d
mke2fs 1.42.10 (18-May-2014)
/dev/mfid0s1d contains a ext2 file system
        created on Fri Sep  8 15:31:19 2017
Proceed anyway? (y,n) y
/dev/mfid0s1d is mounted; will not make a filesystem here!
pod0226-wsa115:rtestuser 5] umount /dev/mfid0s1d
pod0226-wsa115:rtestuser 6] mke2fs /dev/mfid0s1d
mke2fs 1.42.10 (18-May-2014)
/dev/mfid0s1d contains a ext2 file system
        created on Fri Sep  8 15:31:19 2017
Proceed anyway? (y,n) y
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: e588dd9d-1188-4987-8557-face1306ef94
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done 

pod0226-wsa115:rtestuser 7] mount /dev/mfid0s1d /nextroot
mount: /dev/mfid0s1d: Invalid argument
pod0226-wsa115:rtestuser 8] mount -t ext2fs /dev/mfid0s1d /nextroot
pod0226-wsa115:rtestuser 9] 
pod0226-wsa115:rtestuser 9] 
pod0226-wsa115:rtestuser 9] cd /nextroot
pod0226-wsa115:rtestuser 10] ls
lost+found
pod0226-wsa115:rtestuser 11] touch test
pod0226-wsa115:rtestuser 12]

Logs do lado do Linux:

    [38766.411836] EXT4-fs (sda8): mounting ext2 file system using the ext4 subsystem
[38766.414968] EXT4-fs (sda8): ext4_check_descriptors: Block bitmap for group 864 not in group (block 0)!
[38766.415054] EXT4-fs (sda8): group descriptors corrupted!
[38969.028235] EXT4-fs error (device sda1): htree_dirblock_to_tree:1000: inode #106504: block 433181: comm sh: bad entry in directory: rec_len is smaller than minimal - offset=2024(6120), inode=0, rec_len=8, name_len=0
[38969.583757] EXT4-fs error (device sda1): htree_dirblock_to_tree:1000: inode #106504: block 433181: comm sh: bad entry in directory: rec_len is smaller than minimal - offset=2024(6120), inode=0, rec_len=8, name_len=0
[39047.937664] EXT4-fs (sda8): mounting ext2 file system using the ext4 subsystem
[39047.945122] EXT4-fs (sda8): ext4_check_descriptors: Block bitmap for group 864 not in group (block 0)! -------->dmesg logs 
[39047.945209] EXT4-fs (sda8): group descriptors corrupted!
root@pod0226-wsa115:/# 

root@pod0226-wsa115:/# fsck.ext2 /dev/sda8  ----------------> try to run file system check 
e2fsck 1.42.9 (28-Dec-2013)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext2: Group descriptors look bad... trying backup blocks...
Block bitmap for group 880 is not in group.  (block 19660800)
----------------------------------------------------------------->deleted more such messages  -------> far too any error 
Relocate<y>? 
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate<y>? cancelled! ------------> 

/dev/sda8: ***** FILE SYSTEM WAS MODIFIED *****

/dev/sda8: ********** WARNING: Filesystem still has errors **********

root@pod0226-wsa115:/# uname -a
Linux pod0226-wsa115 4.1.21-WR8.0.0.18_standard #1 SMP PREEMPT Mon Aug 21 12:44:02 IST 2017 x86_64 x86_64 x86_64 GNU/Linux
root@pod0226-wsa115:/# 

root@pod0226-wsa115:/# mount /dev/sda8 /test
mount: /dev/sda8 is write-protected, mounting read-only ------------> this line came once. 
mount: wrong fs type, bad option, bad superblock on /dev/sda8, ----> recurring 
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

root@pod0226-wsa115:/# fsck.ext2 /test/
e2fsck 1.42.9 (28-Dec-2013)
fsck.ext2: Is a directory while trying to open /test/

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

root@pod0226-wsa115:/# e2fsck -b 512 /dev/sda8
e2fsck 1.42.9 (28-Dec-2013)
e2fsck: Bad magic number in super-block while trying to open /dev/sda8 ---------->

The superblock could not be read or does not describe a correct ext2
filesystem.  If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>

root@pod0226-wsa115:/# 

root@pod0226-wsa115:/# mkfs.ext2 /dev/sda8 ------------> formating in linux 
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
19660800 inodes, 78643200 blocks
3932160 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
2400 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done                            
Writing inode tables: done                            
Writing superblocks and filesystem accounting information: done     

root@pod0226-wsa115:/# mount /dev/sda8 /test ----------> mount in linux 
root@pod0226-wsa115:/# 


root@pod0226-wsa115:/# fdisk /dev/sda8

Welcome to fdisk (util-linux 2.26.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

/dev/sda8: device contains a valid 'ext2' signature; it is strongly recommended to wipe the device with wipefs(8) if this is unexpected, in order to avoid possible collisions

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x2cd72364.

Command (m for help): 
    
por Satpal Parmar 10.09.2017 / 08:49

0 respostas