NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: disks, partitions, slices, etc.





El 5/10/26 a las 18:59, Jeff escribió:
Just to follow up with results:

I did create the ext2 filesystem with "newfs_ext2fs", then I mounted it in NetBSD and created some test files.  I rebooted into Gentoo and tried to mount it, but got an error about a block overlap, saying that the filesystem needed to be repaired.

I logged back into NetBSD and ran fsck_ext2fs on it, which did not report anything. Then rebooted into Gentoo and still got the error. So I ran fsck on it in Gentoo. It moved a ton of blocks, periodically warning of the potential for data loss. When it was done, I was able to mount the partition in Gentoo. The text file that I had created in the top level of the partition in NetBSD was still there, but the directory containing two other test files was gone. I recreated them in Gentoo, then rebooted into NetBSD. The partition still mounted fine there, and all files that had been visible in Gentoo were present.

So, what worked for me was:
- create ext2 filesystem in NetBSD
- fsck it in NetBSD (possibly unnecessary)
- fsck it in Gentoo

I'll continue to test it going back and forth and see if it's stable now.

Thanks again,
Jeff

Hi Jeff,

I can confirm what you observed. I created an ext2 filesystem in NetBSD in a spare pendrive, copied 5 GB of files and when I tried to mount it in Debian it failed:

netbsd-nuc# fdisk /dev/sd1
fdisk: Cannot determine the number of heads
Disk: /dev/sd1
NetBSD disklabel disk geometry:
cylinders: 65535, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 120164352, bytes/sector: 512

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 120164352

Partitions aligned to 2048 sector boundaries, offset 63

Partition table:
0: Linux native (sysid 131)
    start 63, size 120164289 (58674 MB, Cyls 0-7479/225/42)
        PBR is not bootable: All bytes are identical (0x00)
1: <UNUSED>
2: <UNUSED>
3: <UNUSED>
Bootselector disabled.
No active partition.
Drive serial number: 0 (0x00000000)
netbsd-nuc#



netbsd-nuc# disklabel sd1
# /dev/rsd1:
type: SCSI
disk:  SanDisk 3.2Gen1
label: fictitious
flags: removable
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 65535
total sectors: 120164352
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: 120164352         0     unused      0     0        # (Cyl.      0 - 119210*)
 e: 120164289        63 Linux Ext2      0     0        # (Cyl.      0*- 119210*)
disklabel: boot block size 0
disklabel: super block size 0
netbsd-nuc#

netbsd-nuc# newfs_ext2fs /dev/rsd1e
/dev/rsd1e: 58673.9MB (120164289 sectors) block size 4096, fragment size 4096
	using 459 block groups of 128.0MB, 32768 blks, 16384 inodes.
super-block backups (for fsck_ext2fs -b #) at:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,


root@debian-nuc8i7:~# mount -t ext2 /dev/sdb1 /root/disco_ext4/
mount: /root/disco_ext4: fsconfig() failed: Structure needs cleaning.
       dmesg(1) may have more information after failed mount system call.


root@debian-nuc8i7:~# fsck -y /dev/sdb1
fsck from util-linux 2.41.5
e2fsck 1.47.2 (1-Jan-2025)
ext2fs_check_desc: Corrupt group descriptor: bad block for block bitmap
fsck.ext2: Group descriptors look bad... trying backup blocks...
Block bitmap for group 1 is not in group.  (block 0)
Relocate? yes

Inode bitmap for group 1 is not in group.  (block 0)
Relocate? yes

Inode table for group 1 is not in group.  (block 0)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Block bitmap for group 2 is not in group.  (block 33793)
Relocate? yes

Inode bitmap for group 2 is not in group.  (block 33794)
Relocate? yes

Inode table for group 2 is not in group.  (block 33795)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Block bitmap for group 3 is not in group.  (block 0)
Relocate? yes

Inode bitmap for group 3 is not in group.  (block 0)
Relocate? yes

Inode table for group 3 is not in group.  (block 0)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Block bitmap for group 4 is not in group.  (block 65536)
Relocate? yes

Inode bitmap for group 4 is not in group.  (block 65537)
Relocate? yes

Inode table for group 4 is not in group.  (block 65538)
WARNING: SEVERE DATA LOSS POSSIBLE.
Relocate? yes

Block bitmap for group 5 is not in group.  (block 0)
Relocate? yes

Inode bitmap for group 5 is not in group.  (block 0)
Relocate? yes

Inode table for group 5 is not in group.  (block 0)

..
..

I stopped it.

Regards.
Ramiro.



Home | Main Index | Thread Index | Old Index