How to recover data from home partition

Hi,

I was running Leap 42.2 on my computer and due to certain hardware replacements, I decided to do a fresh install after recovering data. My hard disk is intact and it had a root and home partition (as well as others that the suse installed generates by default). I have installed a temporary linux distro in the root partition and I am trying to use it to recover the data in the home partition. However I am unable to mount it. It is in xfs format.

I tried
sudo mount -t xfs /dev/NAME /mnt
but got the error
mount: /mnt: mount(2) system call failed: No data available.

Thanks for your help.

Output of sudo fdisk -l

Disk /dev/nvme0n1: 238.5 GiB, 256060514304 bytes, 500118192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: ED1B765D-92CE-4F61-8CBF-DEA780593D6D

Device Start End Sectors Size Type
/dev/nvme0n1p1 34 97656 97623 47.7M EFI System
/dev/nvme0n1p2 98304 5787647 5689344 2.7G Microsoft basic data
/dev/nvme0n1p3 5787648 6121471 333824 163M EFI System
/dev/nvme0n1p4 467191808 500117503 32925696 15.7G Linux swap
/dev/nvme0n1p5 6121472 90011647 83890176 40G Linux filesystem
/dev/nvme0n1p6 90011648 467191807 377180160 179.9G Microsoft basic data

Partition table entries are not in disk order.

/dev/nvme0n1p6 is the relevant partition.

More information : Output of lsblk -f

NAME FSTYPE LABEL UUID MOUNTPOINT
nvme0n1
├─nvme0n1p1 vfat 0805-9880 /boot/efi
├─nvme0n1p2 vfat OS 0806-AC09
├─nvme0n1p3 vfat B821-9A2D
├─nvme0n1p4 swap 16b6c11f-1afb-4716-8c99-ea1bee0ce319 [SWAP]
├─nvme0n1p5 ext4 a7f04b77-6153-445f-9533-35533d82ae1e /
└─nvme0n1p6 xfs f2c2a2f1-51a0-44bb-93df-7dd16b6dac5c

What did you put in for NAME


sudo mount -t xfs /dev/NAME /mnt

should be /dev/nvme0n1p6

or

/dev/disk/by-uuid/f2c2a2f1-51a0-44bb-93df-7dd16b6dac5c

Yes, I did put in /dev/nvme0n1p6

Hi
Does the temporary linux install support xfs? If you download and create a Tumbleweed Live Rescue image and boot from that, can you mount the partition?

This does not look like an actual command and error response. It is reminiscent of a failed network or encrytpted mount.

Please copy/paste the actual command and output (inside code tags – the “#” option).

The error is ENODATA which is valid return code for local filesystem, although I am not sure in which case XFS can return it (usually it is associated with missing extended attribute). dmesg messages at the time of mounting may provide some hints.

Please copy/paste the actual command and output (inside code tags – the “#” option).

That for sure :slight_smile:

I apologise for my messy presentation. Here is the output


[akashg@akash-pc /]$ sudo mount -t xfs /dev/nvme0n1p6 /mnt/                                                                                                                                                                                     
mount: /mnt: mount(2) system call failed: No data available.  

Also, I’m not sure if this is relevant but I think the filesystem was encrypted using KWallet. I know the passphrase. But I was under the impression that I should still have been able to mount the partition. Is there a utility that I can use to access it using the passphrase?

Thanks.

Yes it does support xfs. In any case I tried the tumbleweed rescue image and when I tried to mount, I got a similar error box -


Failed to mount "193 GB Volume"

Error mounting /dev/nvme0n1p6 at /run/media/linux/f2c2a2f1-51a0-44bb-93df-7dd16b6dac5c: Command-line `mount -t "xfs" -o "uhelper=udisks2,nodev,nosuid" "/dev/nvme0n1p6" "/run/media/linux/f2c2a2f1-51a0-44bb-93df-7dd16b6dac5c"' exited with non-zero exit status 32: mount: /run/media/linux/f2c2a2f1-51a0-44bb-93df-7dd16b6dac5c: mount(2) system call failed: No data available.

In my experience thee easiest way to recover data from any partition is to use http://www.system-rescue-cd.org/. The instructions are easy to follow and you can use rsync if the partition is sound and dd to make a copy for use with photorec on another device if the partition is not sound.

kWallet does not encrypt filesystems. It does encrypt passwords, and stores them encrypted. Plus, to mount an encrypted partition you need to be able to decrypt what is on it before you can access it.
A bit off-side: I don’t understand why people encrypt their home systems. I do when corporate business is what’s going on. Encryption of filesystems does have it’s risks. F.e. if you forget the decription-password, your data are to be considered as really lost. And, encryption is not something IMNSHO the everyday desktop user needs, and neither something easy to manage for that user. My $ 0.02 …

Hmm… In that case, I’m pretty sure that the filesystem was not encrypted though… (I totally agree with the latter point btw)

Another thing that might be relevant (though I’m not sure) is that when I was trying to boot after changing the motherboard, the SATA controller was in RAID on mode and the installers did not see my hard disk. When I switched to AHCI, everything worked fine and I was able to install except that I couldn’t mount this partition.

Showing the same error over and over again is unlikely to bring us any further. Could you show dmesg output at the time of mounting as was already asked?

The error message could be consistent with a failure to mount an encrypted partition for the reasons suggested by arvidjaar. The reference to Kwallet is a red-herring as the effective unencryption password cannot be stored within an encrypted file.
Make sure that the relevant encryption tools and libraries are installed on the working system. E.g. the packages cryptfs, cryptctl, cryptsetup, encfs etc.

Try using Dolphin in Super-User mode to mount and open the old home filesystem. The available partitions should be listed under “Devices” in the “Places” panel. Dolphin should prompt for the encryption password. You may have to try a few of the displayed devices as the names shown can be confusing.

I would always use “dd_rescue” to copy a device/partition/volume before attemting any aggressive recovery method, and would work on a copy.

Sorry I couldn’t find the dmesg log in /var/log earlier. However, I accessed it using journalctl.

The relevant logs are -


Mar 09 10:44:14 akash-pc kernel: SGI XFS with ACLs, security attributes, realtime, no debug enabled
Mar 09 10:44:14 akash-pc kernel: XFS (nvme0n1p6): Mounting V5 Filesystem
Mar 09 10:44:14 akash-pc kernel: print_req_error: critical medium error, dev nvme0n1, sector 278702430
Mar 09 10:44:14 akash-pc kernel: XFS (nvme0n1p6): metadata I/O error: block 0xb3f225e ("xlog_bread_noalign") error 61 numblks 8192
Mar 09 10:44:14 akash-pc kernel: XFS (nvme0n1p6): failed to find log head
Mar 09 10:44:14 akash-pc kernel: XFS (nvme0n1p6): log mount/recovery failed: error -61
Mar 09 10:44:14 akash-pc kernel: XFS (nvme0n1p6): log mount failed

Thanks.

Here is your “No data available”. You have hardware problem - (at least) one sector is not readable. At this point you are strongly advised to create binary image of partition using dd_rescue (or ddrescue), as hardware problems tend to become worse. Then you can try to recover data from this image.

Oh okay, I’m glad that’s clear now. Thanks a lot!