Opened 16 years ago

Closed 16 years ago

#2707 closed bug (fixed)

cannot mount ext3 file system

Reported by: Adek336 Owned by: axeld
Priority: normal Milestone: R1
Component: File Systems/ext2 Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

On on a SATA drive, fourth logical partition. The file /MyPartitionName, when stat-ed, is shown as a "weird file". hrev27358. Don't know what should I check for.

Attachments (5)

media-1.txt (216.4 KB ) - added by Adek336 16 years ago.
dumpe2fs /dev/hda9 : partition not mountable
adipe.txt (350.1 KB ) - added by Adek336 16 years ago.
dumpe2fs /dev/sda6: mountable
debian.txt (127.5 KB ) - added by Adek336 16 years ago.
dumpe2fs /dev/sda1: mountable
part1.txt (46.1 KB ) - added by Adek336 16 years ago.
lenovo laptop: dumpe2fs /dev/sda10 : unmountable
part2.txt (174.5 KB ) - added by Adek336 16 years ago.
lenovo laptop: dumpe2fs /dev/sda8 : unmountable

Download all attachments as: .zip

Change History (17)

comment:1 by Adek336, 16 years ago

Well, it doesn't happen anymore for a 2-3 weeks now.

comment:2 by Adek336, 16 years ago

I mean, it doesn't happen in revisions which are more recent than 2-3 weeks old.

comment:3 by Adek336, 16 years ago

I think it works for even more, say like 4-5 weeks (not 2-3). Anyway I have an old hrev27770 real hardware install with this problem.

comment:4 by Adek336, 16 years ago

The previous comments are partially wrong. On my laptop, I still can't mount partitions even on hrev28242, /mypartition is "weird file".

On my desktop computer I can mount partitions for about 4-5 weeks now, however some older revisions also had problems - like in hrev27000 (however here it says /mypartition is "directory" not "weird file", but still doesn't work

/mypartition>ls
ls: cannot open directory .: Is a directory
}}})

comment:5 by Adek336, 16 years ago

I have a computer with two ext3 partitions that mount in Haiku and one that doesn't. All three mount in linux. The two mountable partitions have st_mode == 0x41ed, and the value is read from the disk. The other partition, Haiku reads, I think, the wrong block and interprets "0" as it's st_mode, so it is later recognized as a weird file.

Using DiskProbe I found that the good partitions have hexadecimal "ed 41" in block 0x2018, one partition in offset 0x80, the other partition in offset 0x100 into the block. The wrong partition has hexadecimal "ed 41" in block 0x1678, offset 0x80.

For all 3 partitions, in the ext2 module, in Volume::Mount(), deeper in Inode::Inode(), deeper in ext2_get_vnode(), block_cache_get() is called with block == 0x403 I think.

by Adek336, 16 years ago

Attachment: media-1.txt added

dumpe2fs /dev/hda9 : partition not mountable

by Adek336, 16 years ago

Attachment: adipe.txt added

dumpe2fs /dev/sda6: mountable

by Adek336, 16 years ago

Attachment: debian.txt added

dumpe2fs /dev/sda1: mountable

by Adek336, 16 years ago

Attachment: part1.txt added

lenovo laptop: dumpe2fs /dev/sda10 : unmountable

by Adek336, 16 years ago

Attachment: part2.txt added

lenovo laptop: dumpe2fs /dev/sda8 : unmountable

comment:6 by Adek336, 16 years ago

Among the unmountable, both small (~1Gb) and large (~100Gb) partitions appear.

All unmountable partitions have ext_attr feature, no mountable partition has.

All the unmountable partitions have been created recently with gparted under a recent Debian Linux. All the mountable partitions are older and have been created with various tools under Debian.

I think this may be reproducible with a partition made under a recent Debian and gparted.

comment:7 by Adek336, 16 years ago

fixed it. My partitions had an inode size of 0x100 instead of the more common 0x80. Now I can mount the partition and see the names of the files. Unfortunately, the sizes and contents of the files are not read correctly - probably the same problem as below but in another place in the code.

Inodes.cpp:

-     fNode = inodes + volume->InodeBlockIndex(id);
+     fNode = (struct ext2_inode*)   (   ((char*)inodes)  +   volume->InodeBlockIndex(id)  *  volume->SuperBlock().inode_size   );

comment:8 by Adek336, 16 years ago

Now that it mounts and file names can be read, filesizes not, it is easy to get a page fault in kernel space so pointer arithmetic needs more checking.

comment:9 by Adek336, 16 years ago

Volume.cpp

300   -     fInodesPerBlock = fBlockSize / sizeof(ext2_inode); 
300   +     fInodesPerBlock = fBlockSize / SuperBlock().inode_size; 

this seems to fix a bit, but when reading some files I get trash.

comment:10 by axeld, 16 years ago

Component: - GeneralFile Systems/ext2

Thanks for looking into this! I've applied similar changes in hrev28536 (your version was not endian-safe, BTW).

Let's keep this ticket open until reading files is working as well.

comment:11 by Adek336, 16 years ago

I though reading didn't work when MediaPlayer couldn't play movies but I've checked that after all reading works always well.

comment:12 by axeld, 16 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.