LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-21-2005, 09:28 PM   #1
theo444
LQ Newbie
 
Registered: Jul 2005
Location: Colorado
Distribution: Slackware 10.2
Posts: 10

Rep: Reputation: 0
/etc/mtab problem = can't mount anything--cdrom,floppy,etc.


I'm sorry if this question has been answered already but I can't mount any of my cd drives or my floppy drive (or any other removeable media). I've searched all the forums already and haven't found anything quite like the error message I'm getting. In Konqueror, when I double-click on a cd drive to see what's inside, I get

Could not mount device.
The reported error was:

mount: can't open /etc/mtab for writing: Permission denied

In Konsole as root, I get the same message when I try to mount something manually

# mount /dev/hdc
mount: can't open /etc/mtab for writing: Permission denied

When I type "df" to see the mounted filesystems, I get

# df
df: cannot read table of mounted filesystems: Permission denied

If it helps at all, when I type "mount" it prints

# mount
rootfs on / type rootfs (rw)
/dev/root on / type reiserfs (rw)
proc on /proc type proc (rw,nodiratime)
sysfs on /sys type sysfs (rw)

Here's my fstab too,

dev/hda1 swap swap defaults 0 0
/dev/hda2 / reiserfs defaults 1 1
/dev/hdb1 /mnt/hdb1 ntfs ro,user,umask=022 1 0
/dev/hdc /mnt/cdrw iso9660 noauto,user,exec,ro 0 0
/dev/hdd /mnt/dvdrom iso9660,udf noauto,user,exec,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,user,exec,rw 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
#/dev/sda2 /mnt/ipod vfat rw,users,umask=022 1 0
#/dev/fd0 /mnt/floppy subfs fs=floppyfss,rw,user,defaults,iocharset=iso8859-1,sync,umask=0 0 0
#/dev/hdc /mnt/cdrw subfs fs=udf:iso9660,ro,defaults,user,exec 0 0
#/dev/hdd /mnt/dvdrom subfs fs=udf:iso9660,ro,defaults,user,exec 0 0
#/dev/sda2 /mnt/ipod subfs fs=vfat,rw,defaults,user,exec,umask=022 1 0
#tombob.homenet:/srv/public /home/shared/srv subfs \fs=nfs,program=/sbin/net-submountd,interval=5,...defaults 0 0
#tombob.homenet:/home/theo /home/shared/theo subfs \fs=nfs,program=/sbin/net-submountd,interval=5,...defaults 0 0

I've been using submount to mount/umount my drives automatically, but as you can see above, I'm not using submount right now because I wanted to see if it was causing the problem. However, I get the same result whether I use submount or not. Anyway, I also noticed that when I run "lilo", I've recently been getting the following error message (although I don't know if it has anything to do with the problem above):

Warning: LBA32 addressing assumed
Warning: Kernel & BIOS return differing head/sector geometries for device 0x80
Kernel: 65535 cylinders, 16 heads, 63 sectors
BIOS: 1023 cylinders, 240 heads, 63 sectors
Added Slack-2.6.7 *
Added Slack-2.6.12.2
Added Slack-2.4.31
Warning: Kernel & BIOS return differing head/sector geometries for device 0x81
Kernel: 65535 cylinders, 16 heads, 63 sectors
BIOS: 1023 cylinders, 240 heads, 63 sectors
Added Windoze

I used to not get this with lilo, but I've been recompiling my kernel a lot so I don't know what's going on
For the most part, under Windoze, everthing works fine, despite when it occassionally freezes.

Anyway, I really enjoy running Slackware (I'm running Slackware current). I'd hate to have to reinstall all over again after getting settled down and making a whole bunch of tweaks. I don't think that it is the hard drives, since they're both reliable Seagate drives that I've been using for a while (though I can't get reiserfsck to check the reiserfs drive. Thanks ahead of time, though.
 
Old 08-21-2005, 11:14 PM   #2
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Rep: Reputation: 30
Hmm - that's odd. . . it should be using /etc/fstab not /etc/mtab. . . what are the permissions on these two files? (right-click them in Konqueror and click "Properties")
 
Old 08-21-2005, 11:46 PM   #3
theo444
LQ Newbie
 
Registered: Jul 2005
Location: Colorado
Distribution: Slackware 10.2
Posts: 10

Original Poster
Rep: Reputation: 0
Hey, thanks for the quick reply.

Well, I did just as you said and I found out that the permissions of /etc/fstab is read-write only for root. But, interestingly the file /etc/mtab doesn't even exist (I even searched the entire computer for it and found nothing). I have another slack-box that I just got running and /etc/mtab exists on it and fstab is also set to read-write only for root on that computer. Do I need to change the file permissions of fstab?
 
Old 08-21-2005, 11:50 PM   #4
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Rep: Reputation: 30
Quote:
Originally posted by theo444
Hey, thanks for the quick reply.

Well, I did just as you said and I found out that the permissions of /etc/fstab is read-write only for root. But, interestingly the file /etc/mtab doesn't even exist (I even searched the entire computer for it and found nothing). I have another slack-box that I just got running and /etc/mtab exists on it and fstab is also set to read-write only for root on that computer. Do I need to change the file permissions of fstab?
Does this other box have the same problem? If not, you might wanna try copying the mtab from this box to the one that's having the problems.
 
Old 08-22-2005, 12:06 AM   #5
theo444
LQ Newbie
 
Registered: Jul 2005
Location: Colorado
Distribution: Slackware 10.2
Posts: 10

Original Poster
Rep: Reputation: 0
The other box I have doesn't have the same problem so I tried to do what you said. Luckily I was able to transfer the mtab from my working box to the one that's not working via samba. But, as root, if I try to paste mtab into /etc (using Konqueror-Super User Mode), I get

Access denied.
Could not write to /etc/mtab.

I tried copying it to /etc using Konsole and I get

# cp mtab /etc
cp: cannot stat `/etc/mtab': Permission denied

I even tried to create a blank text file /etc/mtab but I got the same errors above.
Any ideas?

Oh yeah,... I also booted off the Slackware CD, mounted my slack partition rw, and tried copying the working mtab to /etc on it. That didn't work so I tried to create a blank mtab, but that didn't work either. Both tries I got a message close to the one above (cannot stat `/etc/mtab': Permission denied).

Last edited by theo444; 08-22-2005 at 12:20 AM.
 
Old 08-22-2005, 12:57 AM   #6
NetRAVEN5000
Member
 
Registered: May 2005
Distribution: Ubuntu 9.04
Posts: 320

Rep: Reputation: 30
Wow, that's strange.
Try doing a reboot and forcing the system into doing "fsck" at reboot by issuing this command as root:
Code:
shutdown -r -F
(and don't forget that the "F" does need to be uppercase - otherwise it won't run "fsck".)
Maybe there's an error on your hard drive - if that's the case maybe "fsck" should fix it.
Note that this will take a while since it's scanning your whole harddrive. If it asks if you want to do a block check or anything, tell it yes - it'll take longer, but it's more likely to fix the problem.
 
Old 08-22-2005, 02:21 PM   #7
theo444
LQ Newbie
 
Registered: Jul 2005
Location: Colorado
Distribution: Slackware 10.2
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks again for the continual replies, NetRAVEN5000.

Okay, as root I typed the command 'shutdown -r -F' to get the computer to reboot. But as it was booting, I think it did check the filesystem, but I'm not sure because it went so fast, like it does when it usually boots. So instead, I booted to the Slack CD and mounted /dev/hda read-only and ran 'reiserfsck --check /dev/hda', but I got

Replaying journal..
No transactions found
Zero bit found in on-disk bitmap after the last valid bit.
Checking internal tree..
Bad root block 0. (--rebuild-tree did not complete)
Aborted

I tried 'reiserfsck --fix-fixable /dev/hda' but got a similar error message. I also tried searching both hard drives for bad blocks with "badblocks -sv /dev/hda" that I found in another post, but when it finally finished, it reported no bad blocks for my Slackware HDD (/dev/hda) and a few on my Windoze drive (which is fine by me since I don't use it much anyway and it's hardly ever mounted).

I'm sorry if I sound like I just keep whining, but I don't know what to do, and if I was left to fix it myself, I'd probably just cause more problems. Do I need to run 'reiserfsck --rebuild-tree' or something or would that only worsen the issue?

Last edited by theo444; 08-22-2005 at 02:29 PM.
 
Old 08-22-2005, 02:35 PM   #8
Master Fox
Member
 
Registered: Aug 2004
Location: UK
Distribution: Arch (Duke / Desktop), FreeBSD 6.1 (Home-Dev server)
Posts: 131

Rep: Reputation: 15
umm, on the other conslusion

dont you normally mount with a mnt path for example on mine i got

mount /dev/hdc /mnt/dvd and it mounts

also fstab should be somthing similar like this
Code:
/dev/hda5        swap             swap        defaults         0   0
/dev/hda9        /                reiserfs    defaults         1   1
/dev/hda1        /windows/1       ntfs        umask=0000,ro,user     1   0
/dev/hda2        /windows/2       ntfs        umask=0000,ro,user 1   0
/dev/hda3        /windows/3       ntfs        umask=0000,ro,user         1   0
/dev/hda6        /windows/4       ntfs        umask=0000,ro,user 1   0
/dev/hda7        /windows/5       ntfs        umask=0000,ro,user          1   0
/dev/hda8        /windows/6       ntfs        umask=0000,ro,user  1   0
/dev/hdc         /mnt/dvd       iso9660     noauto,owner,ro  0   0
/dev/hdd         /mnt/cdrom     iso9660     noauto,owner,ro 0 0
/dev/fd0         /mnt/floppy      auto        noauto,owner     0   0
devpts           /dev/pts         devpts      gid=5,mode=620   0   0
proc             /proc            proc        defaults         0   0
Not sure if this helps atall but it may
 
Old 08-22-2005, 02:53 PM   #9
theo444
LQ Newbie
 
Registered: Jul 2005
Location: Colorado
Distribution: Slackware 10.2
Posts: 10

Original Poster
Rep: Reputation: 0
Normally I do just mount with a mnt path, but when I try to mount my cd-writer, for example, I get
Code:
 # mount /dev/hdc /mnt/cdrw
mount: can't open /etc/mtab for writing: Permission denied
This is the same message I get if I try to mount anything. What about my fstab do you think is wrong? What does /etc/mtab do anyway?
 
Old 08-22-2005, 05:06 PM   #10
Master Fox
Member
 
Registered: Aug 2004
Location: UK
Distribution: Arch (Duke / Desktop), FreeBSD 6.1 (Home-Dev server)
Posts: 131

Rep: Reputation: 15
yeh that was what i wondering my self when i tryed to add swap,

also in root try doing chmod 777 /etc/mtab

but normally its the same as fstab

paste your fstab here it may help

edit: I missed a above post, make a copy of fstab and try renaming it to mtab and then see what happens

Last edited by Master Fox; 08-22-2005 at 05:11 PM.
 
Old 08-22-2005, 10:16 PM   #11
theo444
LQ Newbie
 
Registered: Jul 2005
Location: Colorado
Distribution: Slackware 10.2
Posts: 10

Original Poster
Rep: Reputation: 0
Sorry, it didn't work. I tried
Code:
# chmod 777 /etc/mtab
chmod: cannot access `/etc/mtab': Permission denied
Code:
# cp /etc/fstab /etc/mtab
cp: accessing `/etc/mtab': Permission denied
I don't know what this could mean. It was working fine just a few days ago. All I remember before it began doing this was I had changed the permissions of /bin/mount and /bin/umount so that root and other users could mount and umount devices (I think the two commands were chmod u+s /bin/umount,chmod u+s /bin/mount). That's all I can remember, besides finally getting samba working. Still, thanks for all the help (I'm still thinking of what else to try ).
 
Old 08-23-2005, 01:57 AM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
During bootup, just after mounting /proc the old mtab gets destroyed and a new one is created by running 'mount -a'.
restore your permissions for mount and unmount. Instead, give users explicit permission to mount and unmount by editing /etc/sudoers (run 'visudo').
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
not able to mount floppy,cdrom sharmashikha Linux From Scratch 4 07-18-2005 11:20 PM
cdrom and floppy drive auto mount problem shams Fedora 1 02-27-2005 07:43 AM
not able to mount cdrom or floppy newatthis Slackware 3 12-22-2004 10:37 AM
floppy/cdrom mount problem thar Linux - General 6 10-15-2003 06:05 PM
CDROM and Floppy fail to mount Rito Linux - Newbie 4 01-02-2003 10:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration