Linux Test Session: Mounting media disk with $mount [unedited]
Bijay Kumar Pun
Posted on March 29, 2020
Disk space statistics is an important thing to know
Mounting
The linux file system combines all media disks into a single virtual directory.
Which means, if a new media disk is to be used, it should be placed in the virtual directory, which is called mounting.
In newer version of Linux, thijcls mounting process occurs automatically.
The $mount command
$mount
The $mount lists media devices currently mounted to the system.
From above image
- device_filename on /mount_point type filesystem_type (access_status)
So basically, the $mount command provides 4 pieces of information:
- The device filename of the media
- The mount point in the virtual directory
- The filesystem type
- The access status of the mounted media
/dev/sda2 on / type ext4 (rw,relatime,errors=remount-ro)
This shows that device file sda2 is mounted on root directory / which has a ext4 file type with access status inside braces.
Mounting a device
$mount -t type device directory
This mounts a given device of given type to the given directory
Here:
type
The filesystem type under which the device was formatted
Eg. vfat for windows, ntfs for later windows, iso9880 for cd-rom filesystem etcdevice
the location of the media devicedirectory
the location in the virtual directory (mount point)
Eg. to manually mount the USB memory stick at device /dev/sbd1 at location /media/disk, the command would be:
*$mount -t vfat /dev/sbd1 /media/disk
After it is mounted, the root user has full access to it.
Some additional option:
$-o
The -o option allows mounting file system with comma separated list of addional option such as;
- ro : Read only
- rw : Read / write
- user: allows ordinary user to mount
- check = none : mount without performing integrity test
- loop : mounts a file
Unmounting a file
$umount
The $umount command unmounts a file
*$umount [direcotry|device]
Eg. $ umount /home/rich/mnt
Also check:
https://unix.stackexchange.com/questions/3247/understanding-mount-as-a-concept-in-the-os
Posted on March 29, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 29, 2024