May 23 2008
How to reload fstab changes without a reboot.

If you make a new entry in fstab it will not auto-mount. Therefore you must reload / refresh the entries. A reboot will do this but that is not a friendly way to do it. A quick way to reload new entries in /etc/fstab (fstab) is to use the mount command:
mount -a
For example this morning, my automatically mounted samba shared folder was giving me an error. It seems that the server lost connectivity to the samba server and I didn’t want to reboot the machine or manually mount it.
Here is the error.
[root@nyc ~]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb1 37436532 4386508 31148332 13% /
none 257764 0 257764 0% /dev/shm
/dev/hda1 19623156 3718632 14907696 20% /home
df: `/mnt/samba’: Input/output error
so what I did is unmount the partition.
[root@nyc ~]# umount /mnt/samba
[root@nyc ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb1 37436532 4386508 31148332 13% /
none 257764 0 257764 0% /dev/shm
/dev/hda1 19623156 3718632 14907696 20% /home
then I just run the command umount -a and my samba partition got automatically mounted.
check it out.
[root@nyc ~]# mount -a
[root@nyc ~]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hdb1 37436532 4386512 31148328 13% /
none 257764 0 257764 0% /dev/shm
/dev/hda1 19623156 3718632 14907696 20% /home
//10.0.0.16/centosnyc
243359744 27484160 215875584 12% /mnt/samba
[root@nyc ~]#
For those of you who are curious about how to automount a samba shared directory this is my fstab file. The passwords and usernames are fake ok so make sure you replace them with your own settings.
[root@nyc ~]$ more /etc/fstab
# This file is edited by fstab-sync - see ‘man fstab-sync’ for details
LABEL=/1 / ext3 defaults 1 1
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
//10.0.0.16/centosnyc /mnt/samba smbfs uid=yourunixname,gid=yourunixname,username=user,password=password
,fmask=777,dmask=777 0 0
LABEL=SWAP-hdb2 swap swap defaults 0 0
/dev/hdc /media/cdrom auto pamconsole,exec,noauto,managed 0 0
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
Ok here is how to decypher this
//10.0.0.16/centosnyc /mnt/samba smbfs uid=yourunixname,gid=yourunixname,username=user,password=password
//10.0.0.16/centosnyc the IP address of the samba or windows server / the folder you are trying to access
/mnt/samba smbfs here is the directory you will be mounting and the type of file system
uid=yourunixname,gid=yourunixname,username=user,password=password
you want to create the files inside the directory with your username and user group permissions. you can change that
if you want. Then you need to type the username and password to access that share. Remember that username and password
is different than you unix username and password.
Well hope this made sense.
L8ter fellow Penguins
