[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Picky format of "/etc/fstab" according to "mount" command



Harmon Sequoya Nine wrote:
> 
> Didn't know where to report this.  I looked at the source code, and it's full
> of different names and email addresses -- so the Debian users list seemed like
> a safe bet ...
> 
> The "mount" command seems to be rather picky about the format of the /etc/fstab file.
> In particular, the "options" column.  The comma-separated list of options can't
> just a separated by commas -- each option must be separated by a comma and a space.
> 
> Example:
> 
> ------------------------
> (tao)hnine:/etc[503]$ cat fstab
> # /etc/fstab: static file system information.
> #
> #<filesys>  <mnt pnt>  <type>   <options>                             <dump>  <pass>
> /dev/hdb3       /       ext2    defaults                                0       1
> /dev/hdb1       none    swap    sw                                      0       0
> proc            /proc   proc    defaults                                0       0
> /dev/hdb2       /home   ext2    defaults                                0       2
> /dev/sda1       /jaz    ext2    defaults                                0       0
> /dev/hda1       /dosc   vfat    defaults                                0       2
> /dev/hdd        /cdrom  iso9660 auto, async, dev, exec, ro, suid, user  0       0
> /dev/fd0        /dosa   msdos   defaults, user                          0       0
> 
> (tao)hnine:/etc[504]$ mount /cdrom
> mount: block device /dev/hdd is write-protected, mounting read-only
> (tao)hnine:/etc[505]$
> (tao)hnine:/etc[505]$ mount # EVERTHING IS FINE HERE
> /dev/hdb3 on / type ext2 (rw)
> /proc on /proc type proc (rw)
> /dev/hdb2 on /home type ext2 (rw)
> /dev/hda1 on /dosc type vfat (rw)
> /dev/hdd on /cdrom type iso9660 (ro)
> (tao)hnine:/etc[506]$
> (tao)hnine:/etc[506]$
> (tao)hnine:/etc[506]$ umount /cdrom
> (tao)hnine:/etc[507]$
> (tao)hnine:/etc[507]$ cat fstab # IT'S CHANGED! -- SPACES AFTER COMMAS TAKEN OUT
> # /etc/fstab: static file system information.
> #
> #<filesys>  <mnt pnt>  <type>   <options>                             <dump>  <pass>
> /dev/hdb3       /       ext2    defaults                                0       1
> /dev/hdb1       none    swap    sw                                      0       0
> proc            /proc   proc    defaults                                0       0
> /dev/hdb2       /home   ext2    defaults                                0       2
> /dev/sda1       /jaz    ext2    defaults                                0       0
> /dev/hda1       /dosc   vfat    defaults                                0       2
> /dev/hdd        /cdrom  iso9660 auto,async,dev,exec,ro,suid,user        0       0
> /dev/fd0        /dosa   msdos   defaults, user                          0       0
> 
> (tao)hnine:/etc[508]$
> (tao)hnine:/etc[508]$ mount /cdrom
> (tao)hnine:/etc[509]$
> (tao)hnine:/etc[509]$ mount  # OH, NO!
> /dev/hdb3 on / type ext2 (rw)
> /proc on /proc type proc (rw)
> /dev/hdb2 on /home type ext2 (rw)
> /dev/hda1 on /dosc type vfat (rw)
> /dev/hdd on /cdrom type iso9660 (ro,noexec,nosuid,nodev)
> (tao)hnine:/etc[510]$
> (tao)hnine:/etc[510]$ umount /cdrom
> (tao)hnine:/etc[511]$
> ------------------------
> 
> There is nothing I can see in the documentation about this...
> Can mount be easily changed so that it's not so picky?
> 
> -- Harmon
> 

Spaces and commas should *not* work. How else do you suppose mount
can read the file and know which fields are which? Each 'field' is
separated by whitespace and that's how the file is parsed.

-- 
Jens B. Jorgensen
jjorgens@bdsinc.com


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-user-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: