RHEL7/8/9: xfsrestore only restores directories but not files if the on disk inventory is restored from tape
Issue
When we tried to restore a backup created by xfsdump, xfsrestore created directories but did not create files in them. There were 2 dumps recorded on a single tape device. The contents of the tape device were as following:
file 0: dump data of partition "/boot"
file 1: inventory data of partition "/boot"
file 2: dump data of partition "/"
file 3: inventory data of partition "/"
file 4: (terminator)
To restore partition "/", we did:
# mt -f /dev/nst0 asf 2
# xfsrestore -f /dev/nst0 -S $SESSION_ID /tmp/test -b 524288
xfsrestore: using scsi tape (drive_scsitape) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: searching media for dump
xfsrestore: preparing drive
xfsrestore: examining media file 3
xfsrestore: found dump matching specified id:
xfsrestore: hostname: localhost
xfsrestore: mount point: /mnt/sysimage
xfsrestore: volume: /dev/sda5
xfsrestore: session time: Mon Dec 20 08:30:07 2021
xfsrestore: level: 0
xfsrestore: session label: ""
xfsrestore: media label: ""
xfsrestore: file system id: (_snip_)
xfsrestore: session id: (_snip_)
xfsrestore: media id: (_snip_)
xfsrestore: incorporating on-media session inventory into online inventory
xfsrestore: using on-media session inventory
xfsrestore: searching media for directory dump
xfsrestore: rewinding
xfsrestore: examining media file 0
xfsrestore: inventory session uuid (_snip_) does not match the media header's session uuid (_snip_)
xfsrestore: examining media file 1
xfsrestore: inventory session uuid (_snip_) does not match the media header's session uuid (_snip_)
xfsrestore: examining media file 2
xfsrestore: reading directories
xfsrestore: 33318 directories and 413020 entries processed
xfsrestore: directory post-processing
xfsrestore: restore complete: 92 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore: stream 0 /dev/nst0 OK (success)
xfsrestore: Restore Status: SUCCESS
As the result, directories were restored. However, there were no files restored:
# cd /tmp/test
# ls
etc home mnt proc run tmp var
boot dev export media opt root srv sys usr
# ls home/user/name/
userx
# ls home/user/name/userx/
#
The xfsrestore's log showed that it read file 3 before file 2. So I requested rewinding before invoking xfsrestore. However it did not help to change the result:
# mt -f /dev/nst0 asf 0
# xfsrestore -f /dev/nst0 -S $SESSION_ID /tmp/test3 -b 524288
xfsrestore: using scsi tape (drive_scsitape) strategy
xfsrestore: version 3.1.7 (dump format 3.0) - type ^C for status and control
xfsrestore: using online session inventory
xfsrestore: searching media for directory dump
xfsrestore: preparing drive
xfsrestore: examining media file 0
xfsrestore: inventory session uuid (_snip_) does not match the media header's session uuid (_snip_)
xfsrestore: examining media file 1
xfsrestore: inventory session uuid (_snip_) does not match the media header's session uuid (_snip_)
xfsrestore: examining media file 2
xfsrestore: reading directories
xfsrestore: 25318 directories and 313090 entries processed
xfsrestore: directory post-processing
xfsrestore: restore complete: 2 seconds elapsed
xfsrestore: Restore Summary:
xfsrestore: stream 0 /dev/nst0 OK (success)
xfsrestore: Restore Status: SUCCESS
Referring some sample output on success of xfsrestore
, it seems that a message with "non-directory files" should be there:
:
xfsrestore: reading directories
:
xfsrestore: directory post-processing
xfsrestore: restoring non-directory files
:
Missing of "non-directory files" message means that xfsrestore
failed to read data for non-directory files. Hence it could restore only directory entries but could not restore file entries.
Environment
- Red Hat Enterprise Linux (RHEL) 7, 8 and 9
- xfsdump, various versions
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.