Troubleshooting a Linux Filesystem Issue

  • Thread starter Thread starter Rive
  • Start date Start date
  • Tags Tags
    Linux
Click For Summary
SUMMARY

The forum discussion centers on a filesystem issue encountered during a fresh installation of OpenSUSE, where the user is unable to access data from an old drive after reinstalling the operating system. The problem arises from the use of Btrfs subvolumes, which are mounted independently, leading to the old '/home' directory appearing empty when accessed from the new installation. Users suggest checking partition tables and considering the use of ext4 for better compatibility in future installations. The discussion highlights the complexities of managing data across different filesystems and the potential pitfalls of using Btrfs.

PREREQUISITES
  • Understanding of OpenSUSE installation processes
  • Familiarity with Btrfs subvolumes and their mounting behavior
  • Knowledge of filesystem types, specifically ext4 and Btrfs
  • Basic command-line skills for Linux, including mounting drives and checking partition tables
NEXT STEPS
  • Research how to manage Btrfs subvolumes and their mounting options
  • Learn about partitioning strategies in Linux, focusing on ext4 versus Btrfs
  • Explore tools for inspecting and managing partitions, such as 'gdisk' and 'lsblk'
  • Investigate data recovery options for inaccessible files on Linux systems
USEFUL FOR

This discussion is beneficial for Linux users, system administrators, and anyone involved in managing filesystems, particularly those using OpenSUSE and Btrfs. It provides insights into troubleshooting filesystem issues and best practices for data management across different installations.

Rive
Science Advisor
Messages
3,331
Reaction score
2,895
TL;DR
Trouble with moving files from old install to new one
I have some Opensuse installed around, and I ran into a really disturbing problem yesterday. I've just made a reinstall. Usually, this goes by swapping the drive (usually I keep the old one and do the new install on a different drive), do a clean install, then mount the old drive and move the user data. Usually this works just fine, two or three hours and all set, ready to go: all like the old one, just fresh.

However, this time I just couldn't access the old data at all. I can mount the drive (as root), I see the old '/home' directory, but it's empty.

The same if I boot the old drive and mount (as root) the new one. I see the new '/home', but it's empty.
Even worse, I've created a subfolder there and copied over some data to the new drive /home/temp, but once the boot is from that drive I can't see that directory.

Even worse, the free space shown is actually right all the time, so the system can 'sense' that there are stuff stored there somewhere.

I've a workaround over this (I'll just grab a third drive and transfer files through that), but the problem just keeps nagging me. What's this all about?

Any idea?
 
Last edited:
Computer science news on Phys.org
jedishrfu said:
Have you tried any of these suggestions?
In my case the mount points are different and well defined, no chance of conflict (usually I mount the old drive either under the usual /run/media/whatever or some /temp directory: this time neither works). The similarity is, that the content of the accessed old /home is not visible (while other directories/files are accessible).
More precisely, it is visible only if the old system is used.
(Also, the content of the new /home is visible only for the new system, so the issue is symmetrical.)

Some really baffling issue.

I've managed to copy most of the content through a third drive: starting the old system, mounting the drive and copy over my stuff: then mounting that drive under the new system and restore the files. But this is still weird and not really able to support my trust in Linux systems, since this means that in case the old system is no longer bootable (for any reason) I'll have no chance to get my data.
 
Check your partition table? Most default installs will create a separate partition for /, /usr, /home, etc.
 
  • Like
Likes   Reactions: Tom.G
At least in Windows systems, this is not a unique problem, by default many system files are not shown. There is a 'Hidden' flag in the file directory structure that causes the OS to ignore the entry if requested by a user. But there is also a way though to tell the OS to ignore the 'Hidden' flag, thus showing all the OS files.

And, a few programs install a filter in the file system code to hide certain programs and/or directories.

There may also be a way to hijack a normally unused field in the directory structure. That, along with a Signature (Magic Number) would be all that's needed for your situation.

Hope this helps a little, (and Good Luck!)
Tom

p.s. Please let us know what you find.
 
Tom.G said:
tell the OS to ignore the 'Hidden' flag
I'm root and using the good old MC, so hidden flags/files should not interfere.
At least I thought so:nb)
 
Rive said:
I'm root and using the good old MC, so hidden flags/files should not interfere.
At least I thought so:nb)
What kind of hard drive? Some ssd's will show up as regular /dev/sd* devices, others will be like some weird /dev/nvme* type thing. Do an ''ls /dev' to try and figure out the physical device that is your old hdd, and then do a 'gdisk /dev/<whatever>' to inspect the partitions.
 
Will try. But I can mount and access the old drive (SSd, shows as sd*), just the content of the /home is what's missing (other files in that root are accessible, and there is no separate /home partition there).
 
Rive said:
I'm root and using the good old MC, so hidden flags/files should not interfere.
At least I thought so:nb)
Oh, and also, if you are using a modern ssd, You actually might be boned, because they are encrypted with a security key that is stored in the firmware (usually a TPM). This is to prevent transfer from one machine to another. It might be possible to boot the drive on the previous motherboard and then unlock it. But if you've written anything to it, you might be SOL without some serious skills and luck.
 
  • #10
Rive said:
Will try. But I can mount and access the old drive (SSd, shows as sd*), just the content of the /home is what's missing (other files in that root are accessible, and there is no separate /home partition there).
The ”/” partition will have a "/home" directory entry on it that is empty by design. There maybe be another partition that was previously mounted onto the directory, which would be where you're data (hopefully) resides. So it might be like /dev/sdb3 that you need to look at, as opposed to /dev/sda1. Edit: /dev/sdb1, assuming you only have two "SATA" hard drives. Good luck!
 
  • #11
I would say do an ’ls /dev/sdb*' and try mounting each one of those individually in different (empty) folders.
 
  • #12
Rive said:
The same if I boot the old drive and mount (as root) the new one. I see the new '/home', but it's empty.
Even worse, I've created a subfolder there and copied over some data to the new drive /home/temp, but once the boot is from that drive I can't see that directory.
Just to get you right, you installed OpenSuse on a new drive and when you boot from the old drive and mount the new drive as root you see the expected folders and files except that /home is completely empty? If yes, I would focus on this part of the problem because it already contains all the weirdness and you presumably know the behavior of your old system well.

Do you get the same behavior if you mount the new drive as user instead of root? (like you would mount a usb stick)

Do you find any files on the new drive which belong to the user you created at install? ("find / -user USERNAME")

How have you partitioned the new drive?
 
  • #13
kith said:
Just to get you right, you installed OpenSuse on a new drive and when you boot from the old drive and mount the new drive as root you see the expected folders and files except that /home is completely empty?
Yes. And it's symmetrical: If I boot the new system I see the old /home on the old drive empty.

I'll check the rest later, at home.
 
  • #14
valenumr said:
Check your partition table? Most default installs will create a separate partition for /, /usr, /home, etc.
It's worse than that, openSUSE by default uses separate btrfs subvolumes for /, /usr, /home etc.

I know very little about btrfs except that it has subvolumes which are mounted independently of their parent volume. I think they should have called it mrcmplctdfs.

You might find some help here: https://linuxhint.com/create-mount-btrfs-subvolumes/.

You could also consider creating your new install with ext4 which would at least enable you to mount and see the whole thing when booting from the old system.
 
  • Informative
Likes   Reactions: kith, Wrichik Basu and Rive
  • #15
pbuk said:
You could also consider creating your new install with ext4 which would at least enable you to mount and see the whole thing when booting from the old system.
Very thanks. Looks like you nailed it. I'll check the issue based on the content on that link.
If it's really like that then indeed, a new install is in order :oldcry:
 
  • #16
Here is what the installer wants to do with my (virtual) ssd :eek:
1641313062576.png
 
  • Like
  • Wow
Likes   Reactions: valenumr, Wrichik Basu and Rive
  • #17
And all that mess is within the same partition:confused:
 
  • #18
pbuk said:
It's worse than that, openSUSE by default uses separate btrfs subvolumes for /, /usr, /home etc.
Confirmed. I too have all that mess on my drives (new, old), and of course, the 'old way' mount will mount only the volume, not the subvolumes...

So, ext4 it is. And just one more install.

Very thanks for the info! That link will come especially handy for moving my data.
 
  • #19
pbuk said:
Here is what the installer wants to do with my (virtual) ssd :eek:
View attachment 295090
Oh... I forgot about the "logicAl volume manager". I always manually partition.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 21 ·
Replies
21
Views
3K
Replies
38
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 24 ·
Replies
24
Views
10K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K