Jump to content

Editing fstab file [solved]


skyhawk
 Share

Recommended Posts

I am in the process of "fixing" my /etc/fstab file, as well as, some ownerships and permissions that were auto-generated by my Mandriva 2007.0 installation, and other, miscellaneous issues covered in the errata list. Among other things, my floppy drive is not functioning properly, and my CD-ROM drive configuration could also use some corrective work.

 

I have only Mandriva 2007.0 installed on my hard drive; no Windows or other operating systems.

 

This is what I see when the contents of /mnt are displayed:

 

   [me@mycomputer mnt]$ ls -l
  total 2
  drwxr-xr-x 2 root		root		1024 Jul 24 02:44 cdrom/
  drwxr-xr-x 2 me		  me		   512 Dec 31  1969 floppy/

 

Note that /mnt/floppy omits write permission for user and others. I know this omission needs to be changed, and I know how to change it; no problem here.

 

My current fstab file reads as follows:

 

   /dev/hda1 / ext3 defaults 1 1
  /dev/hda6 /home ext3 defaults 1 2
  /dev/hdc /mnt/cdrom auto umask=0022,users,iocharset=utf8,noauto,ro,exec 0 0
  none /mnt/floppy supermount dev=/dev/fd0,fs=ext2:vfat,--,umask=0022,iocharset=utf8,sync 0 0
  none /proc proc defaults 0 0
  /dev/hda5 swap swap defaults 0 0

 

Here, line 3, field 4 (fs_mntops), contains entries that are puzzling to me; they are not covered on the fstab man page. Lines 4 and 5 should not begin with "none", and line 4, field 4 (fs_mntops), looks strange (again, not covered on the fstab man page). For line 6, field 2 (fs_file)should be "none", according to the fstab man page, which reads, "For swap partitions, this field should be specified as ‘none'." Compare my current fstab file to the following samples:

 

tuXfiles -- The Linux newbie tutorials

< How to edit and understand /etc/fstab - 1.1 >

Sample 1: fstab file (mount points are for SuSE Linux)

 

   /dev/hda2 / ext2 defaults 1 1
  /dev/hdb1 /home ext2 defaults 1 2
  /dev/cdrom /media/cdrom auto ro,noauto,user,exec 0 0
  /dev/fd0 /media/floppy auto rw,noauto,user,sync 0 0
  proc /proc proc defaults 0 0
  /dev/hda1 swap swap pri=42 0 0

 

fstab

From Wikipedia, the free encyclopedia

Sample 2: the following is an example of a fstab file on a Red Hat Linux system

 

# device name   mount point	 fs-type	 options		 dump-freq pass-num
LABEL=/		 /			   ext3		defaults				1 1

/dev/hda6	   swap			swap		defaults				0 0
none			/dev/pts		devpts	  gid=5,mode=620		  0 0
none			/proc		   proc		defaults				0 0

none			/dev/shm		tmpfs	   defaults				0 0

# Removable media
/dev/cdrom	  /mount/cdrom	udf,iso9660 noauto,owner,kudzu,ro   0 0
/dev/fd0		/mount/floppy   auto		noauto,owner,kudzu	  0 0


# NTFS Windows XP partition
/dev/hda1	   /mnt/WinXP	  ntfs		ro,defaults			 0 0

# Partition shared by Windows and Linux
/dev/hda7	   /mnt/shared	 vfat		umask=000			   0 0

 

My proposed fstab file would read as follows, borrowing from the samples above. To the right, I have indicated edited fields that still raise some uncertainty in my mind.

 

   /dev/hda1 / ext3 defaults 1 1
  /dev/hda6 /home ext3 defaults 1 2
  /dev/hdc /mnt/cdrom auto ro,noauto,user,exec 0 0		   <-- field 4
  /dev/fd0 /mnt/floppy auto rw,noauto,user,sync 0 0		  <-- field 4
  proc /proc proc defaults 0 0							   <-- field 1: proc or none?
  /dev/hda5 none swap defaults 0 0						   <-- field 2: swap or none?

 

Lines 1 and 2 remain unchanged. Would Mandriva "experts" viewing this post please critique my proposed changes to fstab? Do they look good, bad, or could they be better? I am sure the points I have covered here will cause many Mandriva 2007.0 users to take a careful look at their fstab file. They probably have auto-generated entries that are causing them grief, without knowing the source of their problems.

 

For those replying, please provide a copy of your fstab file for comparison.

 

 

[moved from Software by spinynorman]

Edited by skyhawk
Link to comment
Share on other sites

I'm no expert skyhawk, but i find what you have written very interesting.

 

Here's my fstab from a 'bog standard' permanently installed Mandriva One 2007.1 Live CD - mostly an office machine.

 

/dev/hda1 / ext3 defaults 1 1
/dev/hda6 /home ext3 defaults 1 2
/dev/fd0 /mnt/floppy auto umask=0,users,noauto,iocharset=utf8,sync 0 0
none /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0
/dev/hda5 swap swap defaults 0 0

 

Here's the one from my Debian Etch box - I added; sda (external usb hdd), hdb (internal ide) and shm (jackd) to it. - Used mostly for multimedia;

 

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>	   <dump>  <pass>
proc			/proc		   proc	defaults		0	   0
/dev/hda1	   /			   ext3	defaults,errors=remount-ro 0	   1
/dev/hda6	   /home		   ext3	defaults		0	   2
/dev/hda5	   /usr			ext3	defaults		0	   2
/dev/hda7	   none			swap	sw			  0	   0
/dev/hdb1	/mnt/hdd	ext3	defaults,errors=remount-ro 0	1
/dev/hdc		/media/cdrom0   udf,iso9660 user,noauto	 0	   0
/dev/hdd		/media/cdrom1   udf,iso9660 user,noauto	 0	   0
/dev/fd0		/media/floppy0  auto	rw,user,noauto  0	   0
/dev/sda	/mnt/sda	ext3	rw,noauto,user	1	0
shm		/dev/shm	 tmpfs	 defaults	 0	 0

 

I guess i just figured that the Mandriva 'live' install would require some very special considerations since it not only acts as a live install, but also has the option to install permanently. This feature of Mandriva Live blows my mind and i totally give big kudos to the developers and contributors for it. The computer and O/S does what it is supposed to do very well and i have resisted my desires to tweak it or experiment at all. If it ain't broke... ;)

 

I hadn't noticed that i wouldn't be able to mount a cdrom in it manually. I will add it and have a better look around the system.

 

I would like to know more though and thought i would register my interest on this discourse in your excellent thread.

Link to comment
Share on other sites

You should not need fstab entries for your removable devices. HAL/DBUS should handle the mounting of these automatically. If you have fstab entries for these devices, it may actually cause problems. I would not change the proc and swap lines at all, as they are fine in your original fstab (yes, proc should have "none" as the device). I also would not remove the tmp directory. In fact, if I were you, I wouldn't mess with the fstab at all, aside from removing the entries for the floppy and cdrom drives.

Link to comment
Share on other sites

Thanks to everyone for the assistance. My fstab file problem is now solved and the file reads as follows:

/dev/hda1 / ext3 defaults 1 1
/dev/hda6 /home ext3 defaults 1 2
/dev/hdc /mnt/cdrom auto ro,noauto,user,exec 0 0
/dev/fd0 /mnt/floppy auto rw,noauto,user,sync 0 0
none /proc proc defaults 0 0
/dev/hda5 swap swap defaults 0 0

In addition to editing the fstab file, I changed permissions for /dev/hdc and /dev/fd0 to match the fs_mntops in the new fstab file. My floppy drive now works perfectly and my CD-ROM is also now under complete control.

 

I had no choice but to edit the fstab file; it was either that or keep on going with a hobbled system. I did take the cautious approach, however, by keeping the changes to a minimum.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...