Sponsored Content
Full Discussion: editing mtab
Top Forums UNIX for Dummies Questions & Answers editing mtab Post 12424 by Neo on Sunday 30th of December 2001 12:33:37 PM
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

 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
MOUNT.NFS(8)						      System Manager's Manual						      MOUNT.NFS(8)

NAME
mount.nfs, mount.nfs4 - mount a Network File System SYNOPSIS
mount.nfs remotetarget dir [-rvVwfnsh ] [-o options] DESCRIPTION
mount.nfs is a part of nfs(5) utilities package, which provides NFS client functionality. mount.nfs is meant to be used by the mount(8) command for mounting NFS shares. This subcommand, however, can also be used as a standalone command with limited functionality. remotetarget is a server share usually in the form of servername:/path/to/share. dir is the directory on which the file system is to be mounted. Under Linux 2.6.32 and later kernel versions, mount.nfs can mount all NFS file system versions. Under earlier Linux kernel versions, mount.nfs4 must be used for mounting NFSv4 file systems while mount.nfs must be used for NFSv3 and v2. OPTIONS
-r Mount file system readonly. -v Be verbose. -V Print version. -w Mount file system read-write. -f Fake mount. Don't actually call the mount system call. -n Do not update /etc/mtab. By default, an entry is created in /etc/mtab for every mounted file system. Use this option to skip making an entry. -s Tolerate sloppy mount options rather than fail. -h Print help message. nfsoptions Refer to nfs(5) or mount(8) manual pages. NOTE
For further information please refer nfs(5) and mount(8) manual pages. FILES
/etc/fstab file system table /etc/mtab table of mounted file systems SEE ALSO
nfs(5), mount(8), AUTHOR
Amit Gud <agud@redhat.com> 5 Jun 2006 MOUNT.NFS(8)
All times are GMT -4. The time now is 09:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy