~3TB ext4 volume not read correctly by ext2-fs driver in GRUB2
Ladies and gentlemen,
It would appear that the ext2-fs driver is not reliably able to read directories on my ~3TB / filesystem:/dev/root 3.4T 1.7T 1.6T 52% //dev/root on / type ext4 (rw,noatime,barrier=1,data=ordered)
Whilst doing some troubleshooting over IRC, I was given a debug patch. With this patch applied, I'll show you a working directory entry (/etc) and a non-working directory entry (/boot):
prometheus ~ # grub-fstest -d ext2 -v /dev/sda3 ls /etc fs/ext2.c:862: grub_fshelp_dir returning: 9fs/ext2.c:862: grub_fshelp_dir returning: 9fs/ext2.c:862: grub_fshelp_dir returning: 9fs/ext2.c:862: grub_fshelp_dir returning: 9fs/ext2.c:862: grub_fshelp_dir returning: 9fs/ext2.c:862: grub_fshelp_dir returning: 9fs/ext2.c:651: iterating inode size=4096 mode=0x41ed fs/ext2.c:688: got filename: '.', type 2fs/ext2.c:862: grub_fshelp_dir returning: 0fs/ext2.c:651: iterating inode size=4096 mode=0x41ed fs/ext2.c:688: got filename: '.', type 2fs/ext2.c:688: got filename: '..', type 2fs/ext2.c:688: got filename: 'lost+found', type 2 fs/ext2.c:688: got filename: 'lib', type 7fs/ext2.c:688: got filename: '.config', type 1 fs/ext2.c:688: got filename: 'sbin', type 2fs/ext2.c:688: got filename: 'root', type 2fs/ext2.c:688: got filename: 'mnt', type 2fs/ext2.c:688: got filename: 'opt', type 2fs/ext2.c:688: got filename: 'var', type 2fs/ext2.c:688: got filename: 'usr', type 2fs/ext2.c:688: got filename: 'dev', type 2fs/ext2.c:688: got filename: 'lib32', type 2fs/ext2.c:688: got filename: 'home', type 2fs/ext2.c:688: got filename: 'tmp', type 2fs/ext2.c:688: got filename: 'media', type 2fs/ext2.c:688: got filename: 'sys', type 2fs/ext2.c:688: got filename: 'cvs', type 2fs/ext2.c:688: got filename: 'proc', type 2fs/ext2.c:688: got filename: 'etc', type 2fs/ext2.c:651: iterating inode size=0 mode=0x0 fs/ext2.c:862: grub_fshelp_dir returning: 0
prometheus ~ # grub-fstest -d ext2 -v /dev/sda3 ls /boot fs/ext2.c:862: grub_fshelp_dir returning: 9 fs/ext2.c:862: grub_fshelp_dir returning: 9 fs/ext2.c:862: grub_fshelp_dir returning: 9 fs/ext2.c:862: grub_fshelp_dir returning: 9 fs/ext2.c:862: grub_fshelp_dir returning: 9 fs/ext2.c:862: grub_fshelp_dir returning: 9 fs/ext2.c:651: iterating inode size=4096 mode=0x41ed fs/ext2.c:688: got filename: '.', type 2 fs/ext2.c:862: grub_fshelp_dir returning: 0 fs/ext2.c:651: iterating inode size=4096 mode=0x41ed fs/ext2.c:688: got filename: '.', type 2 fs/ext2.c:688: got filename: '..', type 2 fs/ext2.c:688: got filename: 'lost+found', type 2 fs/ext2.c:688: got filename: 'lib', type 7 fs/ext2.c:688: got filename: '.config', type 1 fs/ext2.c:688: got filename: 'sbin', type 2 fs/ext2.c:688: got filename: 'root', type 2 fs/ext2.c:688: got filename: 'mnt', type 2 fs/ext2.c:688: got filename: 'opt', type 2 fs/ext2.c:688: got filename: 'var', type 2 fs/ext2.c:688: got filename: 'usr', type 2 fs/ext2.c:688: got filename: 'dev', type 2 fs/ext2.c:688: got filename: 'lib32', type 2 fs/ext2.c:688: got filename: 'home', type 2 fs/ext2.c:688: got filename: 'tmp', type 2 fs/ext2.c:688: got filename: 'media', type 2 fs/ext2.c:688: got filename: 'sys', type 2 fs/ext2.c:688: got filename: 'cvs', type 2 fs/ext2.c:688: got filename: 'proc', type 2 fs/ext2.c:688: got filename: 'etc', type 2 fs/ext2.c:688: got filename: 'lib64', type 2 fs/ext2.c:688: got filename: 'boot', type 2 fs/ext2.c:651: iterating inode size=0 mode=0x0 fs/ext2.c:862: grub_fshelp_dir returning: 0
In order to help troubleshoot this, I can apply patches on top of current SVN, run fstest & test booting for you. Please note that making images of a 3TB drive is not practical and will not reflect the real situation to you.
Sorry, but I am not comfortable offering SSH access to random internet strangers.
Regards,
Tony V.
Quoted 4 lines · Tony Vroon
It would appear that the ext2-fs driver is not reliably able to read directories on my ~3TB / filesystem:
/dev/root3.4T 1.7T 1.6T 52% //dev/rooton / type ext4 (rw,noatime,barrier=1,data=ordered)
Specifically, directories with a high inode number (such as boot) are inaccessible:
chainsaw@prometheus / $ ls -il
total 88
451559425 drwxr-xr-x 2 root root 4096 2009-09-10 22:49 bin
388333569 drwxr-xr-x 3 root root 4096 2009-09-02 23:55 boot
425263105 drwxr-xr-x 4 root root 4096 2009-08-30 16:48 bot
402980865 drwxr-xr-x 20 chainsaw wheel 4096 2009-09-09 21:54 cvs
126 drwxr-xr-x 16 root root 13480 2009-09-10 22:27 dev
411828225 drwxr-xr-x 88 root root 4096 2009-09-12 13:32 etc
303431681 drwxr-xr-x 4 root root 4096 2009-01-10 13:22 home
49153 lrwxrwxrwx 1 root root 5 2009-08-30 07:23 lib ->
lib64
223494145 drwxr-xr-x 3 root root 4096 2009-08-30 07:23 lib32
412385281 drwxr-xr-x 11 root root 8192 2009-09-10 22:50 lib64
11 drwx------ 2 root root 16384 2008-05-30 03:41 lost
+found
308363265 drwxrwxr-x 9 root wheel 4096 2009-09-10 22:27 media
114933761 drwxr-xr-x 8 root root 4096 2009-08-16 02:18 mnt
127959041 drwxr-xr-x 8 root root 4096 2009-08-31 00:01 opt
1 dr-xr-xr-x 217 root root 0 2009-09-10 22:26 proc
48660481 drwx------ 18 root root 4096 2009-09-12 13:55 root
29343745 drwxr-xr-x 2 root root 4096 2009-09-10 22:50 sbin
1 drwxr-xr-x 12 root root 0 2009-09-10 22:26 sys
307658753 drwxrwxrwt 14 root root 8192 2009-09-12 13:55 tmp
195330049 drwxr-xr-x 17 root root 4096 2009-08-30 07:52 usr
163430401 drwxr-xr-x 14 root root 4096 2009-08-30 02:44 varchainsaw@prometheus / $
Inaccessible directories appear empty but do not provoke any errors (which is why it breaks Grub2 startup rather badly, I have to change prefix, insmod normal, normal, etc)
Regards,
Tony V.
Try attached patch
Quoted 97 lines · Tony Vroon
Ladies and gentlemen,
It would appear that the ext2-fs driver is not reliably able to read directories on my ~3TB / filesystem:
/dev/root3.4T 1.7T 1.6T 52% //dev/rooton / type ext4 (rw,noatime,barrier=1,data=ordered)Whilst doing some troubleshooting over IRC, I was given a debug patch. With this patch applied, I'll show you a working directory entry (/etc) and a non-working directory entry (/boot):
prometheus ~ # grub-fstest -d ext2 -v/dev/sda3ls /etcfs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:651: iterating inode size=4096 mode=0x41edfs/ext2.c:688: got filename: '.', type 2fs/ext2.c:862:grub_fshelp_dirreturning: 0fs/ext2.c:651: iterating inode size=4096 mode=0x41edfs/ext2.c:688: got filename: '.', type 2fs/ext2.c:688: got filename: '..', type 2fs/ext2.c:688: got filename: 'lost+found', type 2fs/ext2.c:688: got filename: 'lib', type 7fs/ext2.c:688: got filename: '.config', type 1fs/ext2.c:688: got filename: 'sbin', type 2fs/ext2.c:688: got filename: 'root', type 2fs/ext2.c:688: got filename: 'mnt', type 2fs/ext2.c:688: got filename: 'opt', type 2fs/ext2.c:688: got filename: 'var', type 2fs/ext2.c:688: got filename: 'usr', type 2fs/ext2.c:688: got filename: 'dev', type 2fs/ext2.c:688: got filename: 'lib32', type 2fs/ext2.c:688: got filename: 'home', type 2fs/ext2.c:688: got filename: 'tmp', type 2fs/ext2.c:688: got filename: 'media', type 2fs/ext2.c:688: got filename: 'sys', type 2fs/ext2.c:688: got filename: 'cvs', type 2fs/ext2.c:688: got filename: 'proc', type 2fs/ext2.c:688: got filename: 'etc', type 2fs/ext2.c:651: iterating inode size=0 mode=0x0fs/ext2.c:862:grub_fshelp_dirreturning: 0prometheus ~ # grub-fstest -d ext2 -v
/dev/sda3ls /bootfs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:862:grub_fshelp_dirreturning: 9fs/ext2.c:651: iterating inode size=4096 mode=0x41edfs/ext2.c:688: got filename: '.', type 2fs/ext2.c:862:grub_fshelp_dirreturning: 0fs/ext2.c:651: iterating inode size=4096 mode=0x41edfs/ext2.c:688: got filename: '.', type 2fs/ext2.c:688: got filename: '..', type 2fs/ext2.c:688: got filename: 'lost+found', type 2fs/ext2.c:688: got filename: 'lib', type 7fs/ext2.c:688: got filename: '.config', type 1fs/ext2.c:688: got filename: 'sbin', type 2fs/ext2.c:688: got filename: 'root', type 2fs/ext2.c:688: got filename: 'mnt', type 2fs/ext2.c:688: got filename: 'opt', type 2fs/ext2.c:688: got filename: 'var', type 2fs/ext2.c:688: got filename: 'usr', type 2fs/ext2.c:688: got filename: 'dev', type 2fs/ext2.c:688: got filename: 'lib32', type 2fs/ext2.c:688: got filename: 'home', type 2fs/ext2.c:688: got filename: 'tmp', type 2fs/ext2.c:688: got filename: 'media', type 2fs/ext2.c:688: got filename: 'sys', type 2fs/ext2.c:688: got filename: 'cvs', type 2fs/ext2.c:688: got filename: 'proc', type 2fs/ext2.c:688: got filename: 'etc', type 2fs/ext2.c:688: got filename: 'lib64', type 2fs/ext2.c:688: got filename: 'boot', type 2fs/ext2.c:651: iterating inode size=0 mode=0x0fs/ext2.c:862:grub_fshelp_dirreturning: 0In order to help troubleshoot this, I can apply patches on top of current SVN, run fstest & test booting for you. Please note that making images of a 3TB drive is not practical and will not reflect the real situation to you.
Sorry, but I am not comfortable offering SSH access to random internet strangers.Regards,
Tony V.------------------------------------------------------------------------
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel
Signature · 2 lines
Regards Vladimir 'φ-coder/phcoder' Serbinenko
=== modified file 'fs/ext2.c'
ext2.c +6 -3
@@ -436,7 +436,8 @@grub_uint32_t indir[blksz /4 ];if (grub_disk_read (data->disk, -grub_le_to_cpu32 (inode->blocks.indir_block) + ((grub_disk_addr_t ) +grub_le_to_cpu32 (inode->blocks.indir_block)) << log2_blksz,0 , blksz, indir))return grub_errno;
@@ -452,13 +453,15 @@grub_uint32_t indir[blksz /4 ];if (grub_disk_read (data->disk, -grub_le_to_cpu32 (inode->blocks.double_indir_block) + ((grub_disk_addr_t ) +grub_le_to_cpu32 (inode->blocks.double_indir_block)) << log2_blksz,0 , blksz, indir))return grub_errno;if (grub_disk_read (data->disk, -grub_le_to_cpu32 (indir[rblock / perblock]) + ((grub_disk_addr_t ) +grub_le_to_cpu32 (indir[rblock / perblock])) << log2_blksz,0 , blksz, indir))return grub_errno;