editing mtab


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers editing mtab
# 1  
Old 12-29-2001
editing mtab

Hi all and Happy New Year!!

I'm teaching myself Unix on two Linux boxes (one Red Hat, one SuSE). Anyway, I downloaded and installed patches and fixes for my SuSE box and now I can't mount my cdrom as a user. An error pops up:

Could not mount
mount according to mtab, /dev/hdc is mounted on /dev/hdc
mount failed

Initally the error included fstab (and I couldn't mount as root) but I was able to figure that one out.

Can someone please first tell me what entry I should put in my mtab file so I can once again mount my cdrom as a user? And secondly explain to what fstab and mtab files are used for (if possible, relate them to files used by windows and/or dos)?

I have a few teach yourself books but they don't have mtab in their indexes...

Thank you.
# 2  
Old 12-30-2001
There is no reason to edit mtab.... it is automatically generated... However, I do recall a few occasions when it has been corrupted and I needed to delete the entries. From the mount man page:

Code:
       The programs mount and umount maintain a list of currently mounted file systems
       in  the  file  /etc/mtab.   If  no  arguments  are given to mount, this list is
       printed.  When the proc  filesystem  is  mounted  (say  at  /proc),  the  files
       /etc/mtab  and /proc/mounts have very similar contents. The former has somewhat
       more information, such as the mount options used, but is not necessarily up-to-
       date  (cf.  the -n option below). It is possible to replace /etc/mtab by a sym-
       bolic link to /proc/mounts, but some information is lost that way, and in  par-
       ticular  working  with the loop device will be less convenient. Also, pathnames 
        containing  spaces  are  handled  correctly  by  /etc/mtab  but  not  (yet)  by
       /proc/mounts.

-n     Mount  without writing in /etc/mtab.  This is necessary for example when 
         /etc is on a read-only file system.


FILES
       /etc/fstab file system table
       /etc/mtab table of mounted file systems
       /etc/mtab~ lock file
       /etc/mtab.tmp temporary file

 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert vi editing to text editing

Dear Guru's I'm using Putty and want to edit a file. I know we generally use vi editor to do it. As I'm not good in using vi editor, I want to convert the vi into something like text pad. Is there any option in Putty to do the same ? Thanks for your response. Srini (6 Replies)
Discussion started by: thummi9090
6 Replies

2. Programming

Mount from C code with --no-mtab?

Hi all, I am writing a mount/umount procedure for CD rom and getting into the problem that /etc/mtab is not in sync with /proc/mounts. Then I am ending up with a bunch of dangling /etc/mtab entries that are not valid anymore. Reading through mount(8) I see a -n switch (--no-mtab) which would... (2 Replies)
Discussion started by: mirni
2 Replies

3. Shell Programming and Scripting

Need help in editing a file

I have a file which has 10 million records in it. When am trying to edit the file with vi, the following error occurs: ~ ~ ~ ~ ~ ~ ~ ~ "file1" Value too large for defined data type Is there any way that I can edit this file without using vi? Any help would be really appreciated.... (8 Replies)
Discussion started by: bobby1015
8 Replies

4. Shell Programming and Scripting

editing files.

hello, i have a problem. suppose file.txt i want to add lines over those lines in a file if it starts and ends with how and "?" respectively. i want output like output file.txt thanks (4 Replies)
Discussion started by: yashwantkumar
4 Replies

5. Shell Programming and Scripting

Editing the timestamp

i have data in 3 columns in the format below 2011-11-01-0936,2115,978 2011-11-01-0937,2242,1046 2011-11-01-0938,2538,1186 2011-11-01-0939,2295,1074 2011-11-01-0940,2454,1142 2011-11-01-0941,2545,1184 2011-11-01-0942,2491,1153 I however want to either remove the date on the timestamp and... (2 Replies)
Discussion started by: thinktank
2 Replies

6. Shell Programming and Scripting

editing a file

i am writing a script to edit entries in a file. what command will edit a specific file? ex: echo) "what number would you like to change read "number" this is where I am stuck. what command will edit my specific file? (3 Replies)
Discussion started by: gustave
3 Replies

7. Shell Programming and Scripting

Editing a File

Hi all, I have a file with following contents # rad124 # radkus # raddebug # radtrace I could like to remove the # and space present before the key word "rad". Any ways to do this using "subsitution method(:%s/old/new/g)" will be hepful. (1 Reply)
Discussion started by: ramkriz
1 Replies

8. Shell Programming and Scripting

Editing file

Hi, I am in a situation wherein am getting file file certailn values suppose 1u56979hhghhklklkkkjkjkjk 0 0 0 The file will have values like above only. I need to add another field of NULL value(of length 9) at the end of first column i.e. It should like this after editing:... (4 Replies)
Discussion started by: rahul303
4 Replies

9. Shell Programming and Scripting

Help with editing file

I have a file of 100000 records. This file is created by concatenation of two files. I want to edit this file from record number 80,000 till the end and add "|N" for each record . How can I acheive this. Please suggest (4 Replies)
Discussion started by: dsravan
4 Replies

10. UNIX for Dummies Questions & Answers

Editing files

hi i would like to know whether i can delete a part of a file in C for eg. if my file contained 1234567890 and i want to delete 456 so that it becomes 1237890 is there a way i can do this. well, one way i can achieve this is by creating a new file, copy whatever i want, then... (2 Replies)
Discussion started by: sameersbn
2 Replies
Login or Register to Ask a Question