Click to See Complete Forum and Search --> : Mounted volume files not showing up under new Kernel


Lshink
05-10-2006, 05:27 PM
Hey guys (and girls :D):

This is my first post here. So I'm not exactly sure if this is the right section for this question, but here goes:

I'm running Debian 3.1 (Sarge) on my computer here. I'm still new to linux, but (to my knowledge) I needed to recompile my kernel to enable SMP (its a dual PII 400Mhz machine). Anywho, I did this simply with apt-get install kernel-image-2.6-blahblah-smp. After that I rebooted into the new kernel. Everything worked fine without errors except one little thing, one of my mounted partition's files were completly gone!

Basically, I had three HDDs installed on my Linux machine:

- One SCSI, hooked up to the board itself.
- Two IDEs hooked up through a PCI card.

The files on the SCSI and one of the HDDs on the PCI card a fine. The other files on the HDD of the PCI card are completly gone. As in, I can mount it fine w/o errors, but no files show up.

Heres the weird thing -- when I boot up into the old kernel, everythings fine. I can see all the files on the drive.

Anyone have any ideas?

Again, sorry if this is the wrong section of the forum. :)

bwkaz
05-10-2006, 09:46 PM
Are you getting an error when the new kernel boots, something about a filesystem type not being supported?

Does cat /proc/mounts show the "empty" partition under both kernels? Does cat /proc/filesystems show the same set of FSes supported under both kernels?

Lshink
05-11-2006, 10:02 AM
Well, here is what I found in dmesg:

kjournald starting. Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Adding 746980k swap on /dev/sda5. Priority:-1 extents:1
EXT3 FS on sda1, internal journal
Capability LSM initialized
kjournald starting. Commit interval 5 seconds
EXT3 FS on hde1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting. Commit interval 5 seconds
EXT3-fs warning: checktime reached, running e2fsck is recommended
EXT3 FS on hdg1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.

I'm not sure exactly what it means, but hde1 is the one I'm having trouble with -- not hdg1. I'll edit this post when I get some more information, as you suggested.

EDIT:

Ok, here is /proc/mounts on the old kernel:

rootfs / rootfs rw 0 0
/dev2/root2 / ext3 rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
/dev2/root2 /dev/.static/dev ext3 rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0

And here is /proc/filesystems on the old kernel:

nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev sockfs
nodev futexfs
nodev tmpfs
nodev pipefs
nodev eventpollfs
nodev devpts
ext2
cramfs
nodev ramfs
nodev devfs
nodev mqueue
nodev usbfs
nodev usbdevfs
ext3

Here is /proc/mounts on the new SMP kernel:

rootfs / rootfs rw 0 0
/dev2/root2 / ext3 rw 0 0
proc /proc proc rw,nodiratime 0 0
sysfs /sys sysfs rw 0 0
/dev2/root2 /dev/.static/dev ext3 rw 0 0
tmpfs /dev tmpfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
/dev/hde1 /mae_ssh ext3 rw 0 0
/dev/hdg1 /mae_ssh_backup ext3 rw 0 0

And here is /proc/filesystems on te new SMP kernel:

nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev sockfs
nodev futexfs
nodev tmpfs
nodev pipefs
nodev eventpollfs
nodev devpts
cramfs
nodev ramfs
nodev devfs
nodev mqueue
nodev usbfs
nodev usbdevfs
ext3

So I noticed that under the new kernel the ext2 is not supported, but I'm not sure why the mounts are so different. Anyho, thanks for the help so far :)

bwkaz
05-11-2006, 07:58 PM
First, I doubt ext2 would be causing this.

So just to make sure -- the new, SMP kernel has the partition mounted, while the old, non-SMP kernel does not? And the files show up under the old, non-SMP kernel?

Sounds like when the files were created, the partition was not mounted. So now when the partition is mounted, the files disappear (because an empty FS was mounted over top of them). Try doing something like this under the new, SMP kernel (all as root):

cd
mkdir temp
mount --bind / ./temp This will "bind-mount" your root directory to the ./temp directory. Any files that are on your root filesystem will show up in two places; in (e.g.) /mae_ssh and in ./temp/mae_ssh. With this bind-mount in place, look at what's in the ./temp/mae_ssh and ./temp/mae_ssh_backup directories. If the missing files show up, then mv them from there into /mae_ssh and /mae_ssh_backup (or cp -a them, then verify that they're the same, then delete the stuff under ./temp; either way should work).

Then make sure you do this:

umount ./temp
rmdir temp (still as root), so nothing gets too screwed up.

Note that when you boot to the old kernel, since it doesn't mount hde1 and hdg1, it won't show the files under /mae_ssh and /mae_ssh_backup anymore -- if you want the same files to show up under both kernels, you'll have to keep two copies and manually sync them.

Lshink
05-12-2006, 11:46 PM
Wow, thank you! That worked exactly like you said.

I have one more simple question: I don't quite understand the underlying concept behind what happened - I put files on my partition without mounting it, basically? I didn't know that was possible!

Is there something I should look out for in the future to avoid this happening again (I'm going to assume just make sure my partition is mounted before starting to put files on it, correct me if I'm wrong).

Ah well, I suppose the best way to learn this system is by mistakes! :)

Thanks again!

happybunny
05-12-2006, 11:58 PM
when you mkdir newfolder, you are allowed to put all the files/data/mp3s/stuff in there you want.

Later, you are also then allowed to mount another filesystem (formatted partition) into that folder, so instead of seeing the contents of folder (the files/data/mp3s/stuff), you now only see what ever data is on that newly mounted partition.

Your original data is all still there, but is not accessible because you mounted a different partition there, moving that stuff to the background.

Once you un-mount that new partition, you original data is once again accessible.

How to avoid it? Be more aware of what gets mounted where, thats all

bwkaz
05-13-2006, 09:46 AM
I have one more simple question: I don't quite understand the underlying concept behind what happened - I put files on my partition without mounting it, basically? I didn't know that was possible! Well, not exactly: the files were on your root partition, not the hde1/hdg1 partitions.

But they were hidden because an empty filesystem was mounted over-top of them, in the manner that happybunny explained.

(Oh, and for an explanation of mount --bind: The --bind option takes a source directory and a target directory. When it's done, all the files in the directory tree under the source directory also become visible under the target directory, whether they're visible under the source directory or not. (It's really close to being a hardlink for directories, if you're familiar with those.) And when the kernel figures out what "all the files in the directory tree" means, it stays on the source filesystem, ignoring any other mount points that it happens to see. In this case, that was exactly what you needed. Careful of bind-mounts whose source is higher in the tree than their target, though -- you can get into an infinite recursion that way. That's why it's generally a good idea to keep stuff bind-mounted only as long as absolutely necessary.)