Tuesday, 27 December 2011

mount, remount , fuser and umount, mkswap

We can mount a file system with different options to the filesystem tree to access files in  that.Also, we can unmount filesystem when system needs to be in maintanence mode.

To unmount all filesystems from the system , use:
umount -a
umount [ options ]  device | mount_point
umount references /etc/mount to check for the filesystems that are mounted.

To display who or what is acting on the filesystem , use:
fuser -v mount_point

To kill all actiosn on a filesystem, run:
fuser -km mount_point

To mount a filesystem in rw mode , forexample root filesystem for editing some configuration files, use:
mount -o remount,rw /dev/had1

some additional mount command examples:
mount -t ext3 -o noexec /dev/hda7  : user's home directory is mounted by denying permission to execute files managed there.

mount -t iso9660 -o loop /iso/image.iso /mnt/cdimage : mount the CD-ROM image file image.so read-only using the first loopback device.This provides access to a filesystem , that is itself a file of another filesystem.

mount -t vfat -o uid=500,gid=501 /dev/hdc2 /mnt/projects : mount the vfat filesystem located on the /dev/hdc2 partition so that each file is owned by the specificUID and GID.Normally, filesystem's data would be owned by root (super user), denying direct file manipulation to others.

mount -t ext3 -o noatime /dev/hda2 /data : mount the filesystem using the noatime option to increase I/O performance or battery up-time by reducing disk access.

mount --bind  /x  /y : This mounts a directory already mounted on the filesystem on another mount point

mkswap /dev/hda6 : creates the signature on the partition created using fdisk or other partitioning tool.
                                Add an enty for the swap tp /etc/fstab.It will look like:
                                /dev/hda6 swap swap defaults 0 0 
                                Activate the swap partition using swapon -a
                               Check the swap partition status using swapon -s.

No comments:

Post a Comment

Tweets by @sriramperumalla