Linux block device commands
Most of Linux user use df, du or fdisk, parted to check file system, block devices on a Linux system, me too.
How about trying some new staffs from the linux commands set?
1. lsblk - It is list the block devices info with friendly output,
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238.5G 0 disk
├─sda1 8:1 0 976M 0 part /boot
├─sda2 8:2 0 31.3G 0 part /
└─sda3 8:3 0 206.3G 0 part /home
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part /data
sr0 11:0 1 1024M 0 rom
loop0 7:0 0 100G 0 loop
└─docker-8:2-266441-pool 253:0 0 100G 0 dm
loop1 7:1 0 2G 0 loop
└─docker-8:2-266441-pool 253:0 0 100G 0 dm
How about trying some new staffs from the linux commands set?
1. lsblk - It is list the block devices info with friendly output,
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238.5G 0 disk
├─sda1 8:1 0 976M 0 part /boot
├─sda2 8:2 0 31.3G 0 part /
└─sda3 8:3 0 206.3G 0 part /home
sdb 8:16 0 931.5G 0 disk
└─sdb1 8:17 0 931.5G 0 part /data
sr0 11:0 1 1024M 0 rom
loop0 7:0 0 100G 0 loop
└─docker-8:2-266441-pool 253:0 0 100G 0 dm
loop1 7:1 0 2G 0 loop
└─docker-8:2-266441-pool 253:0 0 100G 0 dm
2. blkid - List block device attributes
dev/sda3: LABEL="/home" UUID="c9018229-5fcb-4ac0-ad4e-8cfbfde14033" TYPE="ext4" PARTUUID="5063ffef-03"
/dev/sdb1: LABEL="/data" UUID="fa0f9a52-734d-4fdc-9413-e987dc27f0c0" TYPE="ext4" PARTUUID="2856a071-01"
/dev/loop0: UUID="0c5593b1-7766-4661-985e-619f08177f5f" TYPE="ext4"
/dev/mapper/docker-8:2-266441-pool: UUID="0c5593b1-7766-4661-985e-619f08177f5f" TYPE="ext4"
/dev/block/8:2: LABEL="/" UUID="35e7b4f9-a93c-42f8-bd18-dd62dd5d441d" TYPE="ext4" PARTUUID="5063ffef-02"
/dev/block/8:1: LABEL="/boot" UUID="611d7adc-0f11-4d5c-8f78-31e2a83f9118" TYPE="ext4" PARTUUID="5063ffef-01"
3. findmnt - Find all file system(mount points) on the system
TARGET SOURCE FSTYPE OPTIONS
/ /dev/sda2 ext4 rw,relatime,data=ordered
├─/sys sysfs sysfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/security securityfs securityfs rw,nosuid,nodev,noexec,relatime
│ ├─/sys/fs/cgroup tmpfs tmpfs ro,nosuid,nodev,noexec,mode=755
│ │ ├─/sys/fs/cgroup/systemd cgroup cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd
│ │ ├─/sys/fs/cgroup/cpu,cpuacct cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
│ │ ├─/sys/fs/cgroup/devices cgroup cgroup rw,nosuid,nodev,noexec,relatime,devices
│ │ ├─/sys/fs/cgroup/memory cgroup cgroup rw,nosuid,nodev,noexec,relatime,memory
│ │ ├─/sys/fs/cgroup/freezer cgroup cgroup rw,nosuid,nodev,noexec,relatime,freezer
│ │ ├─/sys/fs/cgroup/perf_event cgroup cgroup rw,nosuid,nodev,noexec,relatime,perf_event
│ │ ├─/sys/fs/cgroup/hugetlb cgroup cgroup rw,nosuid,nodev,noexec,relatime,hugetlb
│ │ ├─/sys/fs/cgroup/net_cls,net_prio cgroup cgroup rw,nosuid,nodev,noexec,relatime,net_cls,net_prio
│ │ ├─/sys/fs/cgroup/cpuset cgroup cgroup rw,nosuid,nodev,noexec,relatime,cpuset
│ │ └─/sys/fs/cgroup/blkio cgroup cgroup rw,nosuid,nodev,noexec,relatime,blkio
│ ├─/sys/fs/pstore pstore pstore rw,nosuid,nodev,noexec,relatime
│ ├─/sys/kernel/debug debugfs debugfs rw,relatime
│ ├─/sys/kernel/config configfs configfs rw,relatime
│ └─/sys/fs/fuse/connections fusectl fusectl rw,relatime
├─/proc proc proc rw,nosuid,nodev,noexec,relatime
│ ├─/proc/sys/fs/binfmt_misc systemd-1 autofs rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct
│ └─/proc/fs/nfsd nfsd nfsd rw,relatime
├─/dev devtmpfs devtmpfs rw,nosuid,size=16434044k,nr_inodes=4108511,mode=755
│ ├─/dev/shm tmpfs tmpfs rw,nosuid,nodev
│ ├─/dev/pts devpts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000
│ ├─/dev/mqueue mqueue mqueue rw,relatime
│ └─/dev/hugepages hugetlbfs hugetlbfs rw,relatime
├─/run tmpfs tmpfs rw,nosuid,nodev,mode=755
│ ├─/run/user/42 tmpfs tmpfs rw,nosuid,nodev,relatime,size=3288812k,mode=700,uid=42,gid=42
│ │ └─/run/user/42/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=42,group_id=42
│ └─/run/user/1000 tmpfs tmpfs rw,nosuid,nodev,relatime,size=3288812k,mode=700,uid=1000,gid=1000
│ └─/run/user/1000/gvfs gvfsd-fuse fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000
├─/tmp tmpfs tmpfs rw
├─/boot /dev/sda1 ext4 rw,relatime,data=ordered
├─/home /dev/sda3 ext4 rw,relatime,data=ordered
├─/data /dev/sdb1 ext4 rw,relatime,data=ordered
└─/var/lib/nfs/rpc_pipefs sunrpc rpc_pipefs rw,relatime
Just try such commands and enjoy them with your Linux life.
Comments