Professional Documents
Culture Documents
Linux Notes
Linux Notes
the file hierarchy, rooted at /. These files can be spread out over several devices. The mount command serves to attach the file system found on some device to the big file tree The standard form of the mount command, is mount -t type device dir This tells the kernel to attach the file system found on device (which is of type type) at the directory dir. The previous contents (if any) and owner and mode of dir become invisible, and as long as this file system remains mounted, the pathname dir refers to the root of the file system on device Three forms of invocation do not actually mount anything:mount -h : prints a help message mount -v : prints aversion string mount -l : lists all mounted file systems mount --bind olddir newdir : it is possible to remount part of the file hierarchy somewhere else This call attaches only (part of) a single filesystem, not possible submounts. mount --rbind olddir newdir: The entire file hierarchy including submounts is attached a second place. mount --move olddir newdir: atomically move a subtree to another place. mount /dev/cdrom: any user can mount the file system found on his CDROM using this command /etc/fstab : this file may contain lines describing what devices are usually mounted umount : used to un mount the mounted file /etc/mtab : The programs mount and umount maintain a list of currently mounted file systems in the file /etc/mtab mount -a : mounts all the file systems listed in fstab mount -n : Mount without writing in /etc/mtab. This is necessary for example when /etc is on a readonly file system. mount -r : Mount the file system read-only. A synonym is -o ro mount -w : Mount the file system read/write. This is the default. A synonym is -o rw mount -L label : Mount the partition that has the specified label mount -U uuid : Mount the partition that has the specified uuid. mount -t vfstype : The argument following the -t is used to indicate the file system type
Page 1
For the share //windowsserver/sharename to be automatically mounted at every system start (after reboot), insert an option in the file /etc/fstab:
# vi /etc/fstab
Save and close the file. Make sure only root can access your file:
# chown 0.0 /etc/sambapasswords # chmod 600 /etc/sambapasswords
Page 2