[LU-6041] Recover OST specific directories after e2fsck Created: 17/Dec/14  Updated: 22/Dec/14  Resolved: 22/Dec/14

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Jason Hill (Inactive) Assignee: Jian Yu
Resolution: Fixed Votes: 0
Labels: None

Severity: 3
Rank (Obsolete): 16839

 Description   

A backend storage issue caused an OST to get mounted read-only. Remounting showed that the journal entry in the superblock was corrupt. The journal was removed and e2fsck continued; fixing every issue moved all entries into lost+found directory (when mounting the OST as ldiskfs). Next the ext3 internal journal was added back using tune2fs -j /dev/sdd; and another e2fsck was run. It completed successfully. Using ll_recover_lost_found_objs, it appears that the object data is back in place, but there is no CONFIGS, quota_slave, or REMOTE_PARENT_DIR entries. Additionally the oi.* entries are missing as well as the health_check and last_rcvd files.

Is there any way to recover these entries? In the e2fsck output we saw things that look like LU-2638 and also LU-2901.

At this time e2fsck runs to completion and complains about block bitmap differences (lots of them), and Free blocks count (12519 of these messages).



 Comments   
Comment by Jason Hill (Inactive) [ 17/Dec/14 ]

We're running the following versions of e2fsprogs:
[lost+found]# rpm -qa | grep e2fs
e2fsprogs-libs-1.42.9.wc1-7.el6.x86_64
e2fsprogs-devel-1.42.9.wc1-7.el6.x86_64
e2fsprogs-static-1.42.9.wc1-7.el6.x86_64
e2fsprogs-1.42.9.wc1-7.el6.x86_64
e2fsprogs-debuginfo-1.42.9.wc1-7.el6.x86_64

Comment by Peter Jones [ 17/Dec/14 ]

Jian

Could you please advise?

Thanks

Peter

Comment by Andreas Dilger [ 18/Dec/14 ]

There are newer e2fsprogs-1.42.12-wc1, but they won't fix the missing files.

That said, they should all be recreated when the OST is mounted again. Most of the files are not needed on OSTs in any case.

Comment by Jason Hill (Inactive) [ 18/Dec/14 ]

Andreas,

Something I didn't mention above (grave oversight, my fault) is that mount -t lustre /dev/sdd /tmp/lustre/fs/ost11 fails with "This device hasn't been formatted by Lustre".

Comment by Jason Hill (Inactive) [ 18/Dec/14 ]

Would something as simple as a tunefs.lustre --writeconf (with the correct parameters) be sufficient to get this correct? Or would it be better to copy the CONFIGS directory from another OST and then do the writeconf be better?

Comment by Jason Hill (Inactive) [ 18/Dec/14 ]

[oss3 /]# mount -t lustre /dev/sdd /mnt
mount.lustre: /dev/sdd has not been formatted with mkfs.lustre or the backend filesystem type is not supported by this tool

dmesg shows no errors.

[oss3 /]# dmesg | grep -i lustre
[oss3 /]# uptime
11:04:37 up 2 days, 50 min, 2 users, load average: 0.13, 0.07, 0.01

Comment by Andreas Dilger [ 18/Dec/14 ]

Is the CONFIGS/ directory possibly still in lost+found? There shouldn't be much left there after ll_recover_lost_found_objs moved all the objects back to their respective directories.

In particular, CONFIGS/mountdata is one file that isn't recreated automatically at mount time, since that contains info on how to mount tge filesystem, and is what mount.lustre is looking for.

We've recreated this file in the past by copying it from another OST and binary editing the OST index (two places in struct lustre_disk_data: ldd_svname and ldd_svindex).

It might be just as easy to create a small test filesystem on a test node like:

OSTCOUNT=1 FSNAME={name} sh llmount.sh
touch /tmp/ostN
mkfs.lustre --ost --mgsname=$HOSTNAME --index={index of broken OST} /tmp/ostN
losetup /dev/loop4 /tmp/ostN
mkdir /mnt/ostN
mount -t lustre /dev/loop4 /mnt/ostN
umount /mnt/ostN
mount -t ldiskfs /dev/loop4 /mnt/ostN
cp /mnt/ostN/CONFIGS/mountdata /tmp
Comment by Jason Hill (Inactive) [ 22/Dec/14 ]

So I tried the copy from another OST path, modified CONFIGS/mountdata and renamed CONFIGS/sithfs-OST000a to CONFIGS/sithfs-OST000b and then made the modifications there as well.

Mounting now I get errors to stdout saying bad MGS specification and dmesg shows the following:

[root@sith-oss3 CONFIGS]# dmesg
[333605.012087] LDISKFS-fs (sdd): mounted filesystem with ordered data mode. quota=off. Opts:
[333607.639176] LustreError: 11-0: MGC10.36.227.244@o2ib: Communicating with 10.36.227.244@o2ib, operation mgs_target_reg failed with -107.
[333607.652202] LustreError: 166-1: MGC10.36.227.244@o2ib: Connection to MGS (at 10.36.227.244@o2ib) was lost; in progress operations using this service will fail
[333607.667622] LustreError: 3510:0:(obd_mount_server.c:1120:server_register_target()) sithfs-OST000b: error registering with the MGS: rc = -107 (not fatal)
[333607.668041] Lustre: Evicted from MGS (at MGC10.36.227.244@o2ib_0) after server handle changed from 0xddbecfbc8c068220 to 0xddbecfbc8c068506
[333607.668349] Lustre: MGC10.36.227.244@o2ib: Connection restored to MGS (at 10.36.227.244@o2ib)
[333607.706663] LustreError: 3510:0:(llog_osd.c:254:llog_osd_read_header()) sithfs-OST000b-osd: bad log sithfs-OST000b [0xa:0xa:0x0] header magic: 0x32303020 (expected 0x10645539)
[333607.723413] LustreError: 3510:0:(llog_osd.c:254:llog_osd_read_header()) Skipped 1 previous similar message
[333607.733782] LustreError: 3510:0:(mgc_request.c:1707:mgc_llog_local_copy()) MGC10.36.227.244@o2ib: failed to copy remote log sithfs-OST000b: rc = -5
[333607.747895] LustreError: 13a-8: Failed to get MGS log sithfs-OST000b and no local copy.
[333607.756602] LustreError: 15c-8: MGC10.36.227.244@o2ib: The configuration from log 'sithfs-OST000b' failed (-2). This may be the result of communication errors between this node and the MGS, a bad configuration, or other errors. See the syslog for more information.
[333607.781476] LustreError: 3510:0:(obd_mount_server.c:1252:server_start_targets()) failed to start server sithfs-OST000b: -2
[333607.793410] LustreError: 3510:0:(obd_mount_server.c:1723:server_fill_super()) Unable to start targets: -2
[333607.803769] LustreError: 3510:0:(obd_mount_server.c:845:lustre_disconnect_lwp()) sithfs-MDT0000-lwp-OST000b: Can't end config log sithfs-client.
[333607.817767] LustreError: 3510:0:(obd_mount_server.c:1420:server_put_super()) sithfs-OST000b: failed to disconnect lwp. (rc=-2)
[333607.830024] LustreError: 3510:0:(obd_mount_server.c:1450:server_put_super()) no obd sithfs-OST000b
[333607.949653] Lustre: server umount sithfs-OST000b complete
[333607.955474] LustreError: 3510:0:(obd_mount.c:1325:lustre_fill_super()) Unable to mount (-2)
[333707.624293] LDISKFS-fs (sdd): mounted filesystem with ordered data mode. quota=off. Opts:

I either missed something or need to remove something from the local (OST) CONFIGS directory, correct? It looks like Lustre is trying to do the right thing and copy the remote log down:

[333607.733782] LustreError: 3510:0:(mgc_request.c:1707:mgc_llog_local_copy()) MGC10.36.227.244@o2ib: failed to copy remote log sithfs-OST000b: rc = -5

Is it just a permission issue? (perms look the same as the OST I copied the CONFIGS directory from..

[root@sith-oss3 CONFIGS]# ls -la
total 104
drwxr-xr-x 2 root root 4096 Dec 22 12:29 .
drwxr-xr-x 7 root root 4096 Dec 18 15:38 ..
rw-rr- 1 root root 12289 Dec 18 15:38 mountdata
rw-rr- 1 root root 0 Dec 18 15:53 params
rw-rr- 1 root root 46081 Dec 18 16:01 sithfs-OST000b
rw-rr- 1 root root 30384 Dec 18 15:53 sithfs-client

Comment by Jason Hill (Inactive) [ 22/Dec/14 ]

I removed the CONFIGS/sithfs-OST000b file and remounted as lustre; got the "correct" version from the MGS. Now to see if the e2fsck completely screwed up the data or not.

Thanks for your help!

Comment by Andreas Dilger [ 22/Dec/14 ]

The CONFIGS/$fsname-OSTnnnn file is unique to each OST, so copying it from the other OST wouldn't help as you saw. It is fetched from the MGS at mount.

Generated at Sat Feb 10 01:56:41 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.