VFat, fstab and a quick vim tutorial was Re: [Wolves] It just gets worse :-(

Adam Sweet drinky76 at yahoo.com
Thu Feb 3 20:00:03 GMT 2005


 --- Kevanf1 <kevanf1 at gmail.com> wrote: 
> More of the problems with SuSE 9.2  I have now found
> out why I cannot
> save or move stuff from the FAT 32 drive.  I don't
> have permission as
> a normal user.  Hmmm, this is strange as I should
> have.  Ok, I thought
> try to change permission to full access for all
> users.  After all the
> drive is used as a sort of scratch pad.  Unh, huh,
> no can do.  It will
> not let me :-(((  So, I checked fstab.  It should
> read noauto 00 
> nope, it is default 00  I assume this is why I
> cannot change
> permissions.  So, no problem I'll edit fstab to what
> it should be. 
> Hmmm, can't do that, I can't save unless I am logged
> in as root and I
> can't do that.  This is getting very, very
> frustrating.  any ideas
> anybody?

I'm sure the option you want in /etc/fstab is user
which allows a normal user to mount and unmount the
fs. just put it in the options column like so:

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>     
 <dump>  <pass>

/dev/hdb1        /mnt/winc  vfat    rw,user,noauto  0 
     0

This is taken from my own copy of the file (forgive
the line wrap if it looks that way in the email).
Obviously change /dev/hdb1 and /mnt/winc to the device
and mount point for your system.

Use the su command in a shell and supply your root
password to get root priveledges and make a copy of
/etc/fstab with:

cp /etc/fstab /etc/fstab.bak

choose an editor that you think you can live with. I
use vim because I know enough to get by. The following
commands are for vim. This can also serve as a
primitive guide to vim and contains about as much as I
know about it, which is enough to do these kind of
things.

On the command line with root privs:

vim /etc/fstab

You are now in vim, don't panic ;)

Vim is a modal editor in that you have 3 basic modes.
Command which allows you to navigate and issue vim
commands, Insert which allows you to insert stuff and
Replace which allows you to erm... you get it. We will
use the command and insert modes.

It's a good idea to move to where you want to in the
file before using Insert mode, that way you can't
alter the file by mistake. Command mode won't let you
edit the file.

Use the arrow keys to move to the end of the file or
the point at which you wish to start editing and hit
the Insert key. You are now in Insert mode.

So, to add a new line, in Insert mode, hit the right
arrow key to move past the last character and then hit
enter to start a new line.

Now type in the line from above, or add the user
option to the right line. If you're adding the option,
be sure to separate all options with a comma and no
spaces as above. If you're adding a new line, you
don't need to hit enter after you have written the
line.

Note when adding a new line, fstab columns are
separated by tabs not spaces. The the fact that
sometimes the columns don't line up properly doesn't
matter, it's the tab separation that counts.

With your edited file complete, hit Esc to get back to
command mode. It's a good idea to drop back to command
mode before moving around somewhere else and editing
again for the same reasons as above.

If you made a mistake that you don't know how to
retrieve you can get out of vim in the following ways.

Vim commands, issued in command mode obviously, start
with the colon character ':', followed by the command.

:q means quit.
:q! means quit without saving.

If you are happy with your file, use

:wq to write the file and quit.

When you have quit vim, issue exit to return to a
normal user.

Not that hard is it?

Now try to mount your filesystem as a normal user.
With a complete fstab entry, you should be able to
mount it just using the device name or mount point,
the rest will be figured out from fstab. So you should
be able to do

mount /dev/hdb1

or 

mount /mnt/winc

If it doesn't work for some reason, go back and change
your file accordingly. If you don't know what to do,
use the following commands to restore your original
file

cp /etc/fstab.bak /etc/fstab

This will leave your backup file so you can edit in
future without making another backup. If you want to
get rid of the backup while restoring, instead use

mv /etc/fstab.bak /etc/fstab

Think thats about it. If any of the above is wrong,
feel free to make this a wiki style email, everyone ;)

Ad

=====
-- 

http://www.drinky.org.uk


	
	
		
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com



More information about the Wolves mailing list