Skip to main content

mountpoint

Mount Point:
#lsblk
The command lsblk by default will list all block devices in a tree-like format. Open your terminal and type the command as follows:
$ lsblk
The output is as follows: There are seven columns namely:
NAME : This is the device name.
MAJ:MIN : This column shows the major and minor device number.
RM : This column shows whether the device is removable or not. Note in this example the device sdb and sr0 have their RM values equals to 1 indicating they are removable.
SIZE : This is column give information on the size of the device. For example 298.1G indicate the device is 298.1GB and 1K indicate the device size is 1KB.
RO : This indicates whether a device is read-only. In this case all devices have a RO=0, indicating they are not read only.
TYPE :This column shows information whether the block device is a disk or a partition(part) within a disk. In this example sda and sdb are disks while sr0 is a read only memory (rom).
MOUNTPOINT : This column indicates mount point on which the device is mounted.
List All Devices
The default option does not list all empty devices. To view these also use the command as follows:
$ lsblk -a
This option will list all devices including empty ones.
List Device Permissions and Owner
The command lsblk can also be used to list the ownership of a particular device as well as the group the mode. This can be achieved as follows:
$ lsblk -m
List Specific Devices
It is possible also to get information about a specific device only. This can be achieved by specifying the device name after the option supplied to lsblk. For example you would be interested to know your hard drive size in bytes. You can accomplish this by running the command as follows:
$ lsblk -b /dev/sda
or if you prefer:
$ lsblk --bytes /dev/sda





2. df command
In linux df command is used to display the amount of total and free disk space available on the mounted file systems. Using df options you can find used blocks, inodes and free space available in the file system. In Linux, there are lots of others tools like ncdu, crusader, KDiskFree, Gnome Disk utility to monitor the disk usage. In this article, we show you a nice option of df command to display mount point using specific filesystem type.
1) Default and human readable
Default and human readable format shows used space, available free space, percentage of space used and mount path.
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/hda2 9448100 3549668 5418492 40% /
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 7.6G 1.9G 5.4G 26% /
tmpfs 478M 0 478M 0% /dev/shm
2) Display Filesystem Type
df command have an option -T shows fileystem type of mounted file system. Below ouput shows /dev/sda7  and /dev/sda8 on ext4 filesystem.
# df -T
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda7 ext4 10079084 6468168 3098916 68% /
/dev/sda8 ext4 5039616 2948128 1835488 62% /home
3) Display Mount point on specific filesystem
You can use -t followed by filesytem type (say ext3, ext4, nfs) to display respective mount points. For examples below df command display all nfs mount points.
# df -HP -t nfs




Comments

Popular posts from this blog

sed

Sed Command in Linux/Unix with examples SED command in UNIX is stands for stream editor and it can perform lot’s of function on file like, searching, find and replace, insertion or deletion. Though most common use of SED command in UNIX is for substitution or for find and replace. By using SED you can edit files even without opening it, which is much quicker way to find and replace something in file, than first opening that file in VI Editor and then changing it. o     SED is a powerful text stream editor. Can do insertion, deletion, search and replace(substitution). o     SED command in unix supports regular expression which allows it perform complex pattern matching. Syntax: sed OPTIONS... [SCRIPT] [INPUTFILE...] Example: Consider the below text file as an input. $cat > geekfile.txt unix is great os. unix is opensource. unix is free os. learn operating system. unixlinux which one you choose. unix is easy to learn.unix ...

initramfs" file is deleted or corrupted on your RHEL or CentOS 7

Initrd/Initramfs image provides the capability to load a RAM disk by the boot loader. This RAM disk can then be mounted as the root filesystem and programs can be run from it. Afterwards, a new root file system can be mounted from a different device. The previous root filesystem which was mounted from initrd/initramfs is then moved to a directory and can be subsequently unmounted. Their are chances that either you might have accidentally deleted "initramfs" file from the /boot partition or it is corrupted due to some reason.  Then boot process will get interrupted and you will see below error: error: file '/initramfs-3.10.0-957.el7.x86_64.img' not found. Good news is you can still recover this "initramfs" by following below steps: Step 1 :  Mount RHEL or CentOS 7 ISO image on your physical server and boot from it. In case you are using HPE Prolient server you can mount this ISO image on iLO, if this is virtual environment then mount it accordingly and reboot...

nw commands

troubleshoot commands in Linux.   1. ifconfig ifconfig (interface configurator) command   is use to initialize an interface, assign IP  Address to interface and enable or disable  interface on demand. With this command  you can view IP Address and Hardware / MAC   address assign to interface and also MTU (Maximum transmission unit) size. # ifconfig   eth0       Link encap:EthernetHWaddr 00:0C:29:28:FD:4C inet addr:192.168.50.2   Bcast:192.168.50.255   Mask:255.255.255.0           inet6 addr: fe80::20c:29ff:fe28:fd4c/64 Scope:Link           UP BROADCAST RUNNING MULTICAST   MTU:1500   Metric:1           RX packets:6093 errors:0 dropped:0 overruns:0 frame:0  ...
# # #