Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was having issues where my Ubuntu system was not able to boot. I created a boot disk and went in and messed around. In the end, with the help of these forums, I am able to boot again and everthing seems back to normal except I get the following when I do a "df":
This looks strange doesnt it? There is no hda3,hda1, etc... Anybody know what is going on here and if it's ok? Also, I have tons of photos on this server so this does not seem like an accurate disk usage. I am not really knowledgable on how the mounts or partitions should be setup.
Yeah, something should be mounted on /. Try running '/bin/df' directly, in case there are any aliases or anything with weird arguments. Also, what is the output of 'mount'?
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
devshm on /dev/shm type tmpfs (rw)
lrm on /lib/modules/2.6.15-27-386/volatile type tmpfs (rw)
I'll try to find the thread of instructions I followed to get my system back to booting when it was having serious issues before. And all files are visible from what I can see. I have multiple app servers, web servers, and databases on this box and all are running perfectly.
Unfortunately, the only thing I could think of that would cause this is a rootkit or something.
It doesn’t look like a rootkit to me (since the mountpoints are not hidden at the kernel level—i.e., they’re reported correctly by /proc/mounts). The cause seems to me to be incorrect permissions on /etc/mtab and family. Could you post the output of:
Hmm… These seem like fine permissions to me. Perhaps at the time of mounting, the permissions are not fine. Or perhaps your startup scripts (or whatever you use) are calling “mount -n” (which abstains from writing to /etc/mtab).
You might try a few diagnostics to see if the mount program itself will update /etc/mtab as it is supposed to do. Try the following with a few “dummy” filesystems (first with a tmpfs, then with a non-nodev filesystem): The command prompt has been left off for easy copy-and-pasting (in the hope that you will copy and paste the entire output to the forum):
Code:
sudo bash
cp /etc/mtab /etc/mtab.original
mkdir /my_new_tmpfs
mount -t tmpfs none /my_new_tmpfs
mount
diff -u /etc/mtab{.original,}
cd /my_new_tmpfs
mkdir my_new_mountpoint
dd if=/dev/zero of=my_image.img count=2048
mke2fs -F my_image.img
mount -o loop my_image.img my_new_mountpoint
mount
diff -u /etc/mtab{.original,}
umount my_new_mountpoint
cd /
umount my_new_tmpfs
rm -r my_new_tmpfs /etc/mtab.original
exit
(N.B., The command prompt has been left off for easy copy-and-pasting — in the hope that you will copy and paste the output to the forum)
As for solutions, there are a few. Obviously, the ideal solution is to find out why mtab is not being written to at system starup. I think that hand-editing /etc/mtab (adding the entries from /proc/mounts, but leaving out things like “rootfs / rootfs rw 0 0”) is very kludgey, but will last if umount doesn’t write to /etc/mtab at system shutdown. If this happens (i.e., your mtab has information properly removed by umount, yet not properly added by mount), I suggest symlinking /etc/mtab to /proc/mounts. Though symlinking will work, it is not ideal, since there is some information not stored in /proc/mounts (about how mount was called — especially with loopback devices).
P.S., I noticed the modification date on your /etc/mtab is quite behind. Do you shut off your machine at night, or has this computer been on since “2007-05-12 20:12”? If you do shut off your machine, this time gives us a clue as to when the last successful write to /etc/mtab occurred.
Thanks for the great reply! Sorry, I was out of town so haven't had an oppotunity to do any testing with this until today.
Yes, the last restart was on 5/12 so looks like the write to mtab was fine.
Here are the results of the execution:
Code:
sudo bash
cp /etc/mtab /etc/mtab.original
mkdir /my_new_tmpfs
mount -t tmpfs none /my_new_tmpfs
mount
root@asiago:~# cp /etc/mtab /etc/mtab.original
cd /my_new_tmpfs
root@asiago:~# mkdir /my_new_tmpfs
mkdir my_new_mountpoint
dd if=/dev/zero of=my_image.img count=2048
mke2fs -F my_image.img
mount -o loop my_image.img my_new_mountpoint
mount
diff -u /etc/mtab{.original,}
umount my_new_mountpoint
cd /
root@asiago:~# mount -t tmpfs none /my_new_tmpfs
umount my_new_tmpfs
root@asiago:~# mount
rm -r my_new_tmpfs /etc/mtab.original
exitproc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
devshm on /dev/shm type tmpfs (rw)
lrm on /lib/modules/2.6.15-27-386/volatile type tmpfs (rw)
none on /my_new_tmpfs type tmpfs (rw)
root@asiago:~# diff -u /etc/mtab{.original,}
--- /etc/mtab.original 2007-05-31 10:35:29.000000000 -0500
+++ /etc/mtab 2007-05-31 10:35:29.000000000 -0500
@@ -7,3 +7,4 @@
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
devshm /dev/shm tmpfs rw 0 0
lrm /lib/modules/2.6.15-27-386/volatile tmpfs rw 0 0
+none /my_new_tmpfs tmpfs rw 0 0
root@asiago:~# cd /my_new_tmpfs
root@asiago:/my_new_tmpfs# mkdir my_new_mountpoint
root@asiago:/my_new_tmpfs# dd if=/dev/zero of=my_image.img count=2048
2048+0 records in
2048+0 records out
1048576 bytes (1.0 MB) copied, 0.005251 seconds, 200 MB/s
root@asiago:/my_new_tmpfs# mke2fs -F my_image.img
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
128 inodes, 1024 blocks
51 blocks (4.98%) reserved for the super user
First data block=1
1 block group
8192 blocks per group, 8192 fragments per group
128 inodes per group
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 24 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
root@asiago:/my_new_tmpfs# mount -o loop my_image.img my_new_mountpoint
root@asiago:/my_new_tmpfs# mount
proc on /proc type proc (rw)
/sys on /sys type sysfs (rw)
varrun on /var/run type tmpfs (rw)
varlock on /var/lock type tmpfs (rw)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
devshm on /dev/shm type tmpfs (rw)
lrm on /lib/modules/2.6.15-27-386/volatile type tmpfs (rw)
none on /my_new_tmpfs type tmpfs (rw)
/my_new_tmpfs/my_image.img on /my_new_tmpfs/my_new_mountpoint type ext2 (rw,loop=/dev/loop0)
root@asiago:/my_new_tmpfs# diff -u /etc/mtab{.original,}
--- /etc/mtab.original 2007-05-31 10:35:29.000000000 -0500
+++ /etc/mtab 2007-05-31 10:35:29.000000000 -0500
@@ -7,3 +7,5 @@
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
devshm /dev/shm tmpfs rw 0 0
lrm /lib/modules/2.6.15-27-386/volatile tmpfs rw 0 0
+none /my_new_tmpfs tmpfs rw 0 0
+/my_new_tmpfs/my_image.img /my_new_tmpfs/my_new_mountpoint ext2 rw,loop=/dev/loop0 0 0
root@asiago:/my_new_tmpfs# umount my_new_mountpoint
root@asiago:/my_new_tmpfs# cd /
root@asiago:/# umount my_new_tmpfs
root@asiago:/# rm -r my_new_tmpfs /etc/mtab.original
root@asiago:/# exit
exit
I'm not very experienced in this so kind of lost on what you're looking for. But let me know your opinion please. Thanks again for the help!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.