Troubleshooting a Linux Filesystem Issue

  • Thread starter Rive
  • Start date
  • Tags
    Linux
In summary: It could be a mount problem where one mount is superseding another.Have you tried any of these suggestions?
  • #1
Rive
Science Advisor
2,952
2,396
TL;DR Summary
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
  • #3
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.
 
  • #4
Check your partition table? Most default installs will create a separate partition for /, /usr, /home, etc.
 
  • Like
Likes Tom.G
  • #5
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.
 
  • #6
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)
 
  • #7
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.
 
  • #8
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).
 
  • #9
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 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 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.
 

1. What are the common signs of a Linux filesystem issue?

Some common signs of a Linux filesystem issue include system crashes or freezes, missing or corrupted files, slow performance, and error messages when trying to access certain files or directories.

2. How can I troubleshoot a Linux filesystem issue?

The first step in troubleshooting a Linux filesystem issue is to identify the root cause. This can be done by checking system logs for any error messages, running diagnostic tools such as fsck to check for filesystem errors, and examining the hardware for any issues. Once the root cause is identified, appropriate actions can be taken to resolve the issue.

3. How do I fix a corrupted Linux filesystem?

If the filesystem is corrupted, it is important to first make a backup of any important data. Then, the filesystem can be repaired using tools such as fsck or by reformatting the filesystem. In some cases, it may be necessary to reinstall the operating system.

4. How can I prevent filesystem issues in the future?

To prevent filesystem issues, it is important to regularly perform maintenance tasks such as running filesystem checks, monitoring disk usage, and keeping the system up to date with software updates. It is also recommended to have a backup system in place to prevent data loss in case of a filesystem issue.

5. Is it possible to recover data from a damaged Linux filesystem?

In some cases, data can be recovered from a damaged Linux filesystem using data recovery software. However, it is not always guaranteed and it is important to have a backup of important data to avoid permanent data loss. It is also recommended to seek professional help if the data is critical.

Similar threads

  • Computing and Technology
Replies
5
Views
269
  • Computing and Technology
Replies
2
Views
742
  • Computing and Technology
Replies
21
Views
2K
Replies
38
Views
3K
  • Computing and Technology
Replies
30
Views
2K
  • Computing and Technology
Replies
24
Views
7K
  • Computing and Technology
Replies
3
Views
2K
  • Computing and Technology
Replies
18
Views
1K
Replies
2
Views
2K
  • Computing and Technology
Replies
1
Views
1K
Back
Top