Files in /var/lib/mysql/ are not displaying from an external drive, but they do exist.

My server crashed where i had no graphics. no display at all. so I took the hard drive out and hooked it up to my backup server to get the sites and databases off it. Everything went smoothly with mounting and I can see most of the files but I can’t access any files in /srv/www/ or /var/lib/mysql. I’ve tried ls -a thinking they were set to hidden but they were not. I know the files are there because the server was still working even though there was no graphics. So i’m wondering what is happening so that i can’t see these files and is there a way to get to cd ~ on the external? Cause I have a file there I need as well. Thanks in advance.
I’m running opensuse leap 42.2 on a dell optiplex 745… I know its super old.

Please show!

ls -l /srv/www/ 
ls -l /var/lib/mysql

And explain what you mean with “I can’t access any files in”. There is no “I” on the system. There are only users. So tell us which user can’t.

First I would like to apologize for not explaining myself very well. So I can access /srv/www and /var/lib/mysql folders on my current servers drive. My problem is I have an external drive attached that came from my old server. That drive shows empty folders or in the case of /srv/www/ its actually /srv/ that is empty. I’m using su - to be logged in as root and before you say how stupid that is, I know it’s just faster than typing in sudo for everything until i get it up and running again. screen shot bellow is of the external that i’m trying to get data from. I booted up from it and it still has the websites there and are accessible from the internet I just can’t see them on the drive. Thanks again and I hope that was a little clearer.
https://drive.google.com/open?id=0B37DB3CW1topOWpHWVNqVV9YX1U

https://drive.google.com/open?id=0B37DB3CW1topOWpHWVNqVV9YX1U

That proves what I said I guess. When you would have posted the ls -l of that directory, we would have seen what and where it was.

But yes, it looks complete empty. Could the original /srv/www have been on a different file system? You would then see this in the /etc/fstab of your original system.

BTW, when you want to post computer texts here in the forums, please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

When that is impossible for some reason and you have to fall back on images, better store them in http://paste.opensuse.org/. Not every body trusts Google ;).

thank you for the help with the code input. was trying to work with a screenshot and didn’t even think about that until after I posted. I do see /etc/fstab is saying that

/var/lib/mysql btrfs subvol=@/var/lib/mysql 0 0

There are several others as well as /srv/ in there too.

what does that mean?

That are sub-volumes of your Btrfs for use with snapper. No connection with a real separate mounted file system on /srv/www.

It was just a shot in the dark. When /srv/www is another file system, it’s contents would not have shown up in /usr/media/…/srv when not mounted there.

I am a bit out of ideas. Maybe others will jump on this thread.

These are two filesystems. I have my new server and old server so I can understand if there is a conflict. Could that be causing it not to show up in the /media/drive?

Nope (as far as I understand your situation).

I e.g. have on my one disk a root file system (SystemA) and a home file system (homeA) and another root file system (SystemB) and another home file system. They have different versions of openSUSE on them. Say both …A are my running system and the …B is the last version of openSUSE I used not long ago.

When I boot from SystemA (Grub2 offers them both), System A is mounted on / and HomeA is mounted on /home. When I then need something from the other system, I mount SystemB on /mnt. Then I can e.g. look into the /etc files of SystemB. I can then also mount HomeB on /mnt/home. Then I have access to all user data as it was in the old system. Easy to check configs, etc. around the time I switch versions.

I can also not mount SystemB and mount HomeB on e.g. /mnt when i only want to use the old user data.

But what I want to show to you is that those …B file systems are just file systems for the running SystemA. Nothing more, nothing less.

You’ve shown us that your disk has a btrfs filesystem. Put it back in the server and boot from a previous snapshot .

That content of /var/lib/mysql resides in subvolume. Mount filesystem using top-level (not default) subvlume

mount -t btrfs -o subvol=/ /dev/sdX /mnt

and you will find it under /mnt/@/var/lib/mysql (just append full path from subvol to mount point). As this was root filesystem, it has default subvolume set to one of snapshots, so when you mount it you see only content of this default subvolume, not full filesystem.

Ah, you really should use and study Btrfs before you run into trouble.

Glad I do not use it. :wink:

It means that, in order to get a full available mount of a btrfs, you should also mount all the snapshot mounts (that showed in your fstab when it was a real /) also relative to the new mountpoint. Go figure.

thank you for all your advice. I eventually just used a recovery tool and got the data that i needed and filled in the rest with backups from the sites. One of these days i’ll smooth out the process of transferring my server to another. I still don’t really know what happened but my solution was to use a recovery tool, although I did notice some of the data was missing or misplaced so anyone else that is trying to figure out this problem might not want to try that. Anyway Thanks to all that replied.