• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

blkid: command not found

by admin

The blkid command offers similar functionality to lsblk, but it simply prints each block device in a flat format and includes some additional information like device/ partition UUID and file system type. However, it is preferable to use lsblk -f if you want this additional information.

Syntax

The syntax of the blkid command is:

# blkid [options] [device name]

You can easily list the UUIDs of your volumes with the blkid command:

# blkid

The output will show you the UUID of each device attached to your system, and you can use this command any time you add new volumes to your server to list your UUIDs. This is also the first step in adding a new volume to your /etc/fstab file. While I did say that using UUIDs is not required, it’s definitely recommended and can save you from trouble later on.

If you encounter below error while running the blkid command:

blkid: command not found

you may try installing the below package as per your choice of distribution:

Distribution Command
OS X brew install util-linux
Debian apt-get install fdisk
Ubuntu apt-get install fdisk
Alpine apk add util-linux
Arch Linux pacman -S util-linux
Kali Linux apt-get install fdisk
CentOS yum install util-linux
Fedora dnf install util-linux
Raspbian apt-get install util-linux

You can also use the blkid utility to check the filesystem type, as shown in this snipped example from an Ubuntu system:

$ sudo blkid
/dev/sda1: [...] TYPE="ext4"
/dev/sda5: [...] TYPE="swap"
/dev/sdb1: [...] TYPE="ext4"
$

This output also shows that the filesystem on /dev/sdb1 is an ext4 filesystem.

blkid Command Examples

1. List all partitions:

$ sudo blkid

2. List all partitions in a table, including current mountpoints:

$ sudo blkid -o list

Conclusion

A UUID is a unique identification number assigned when the partition or volume is formatted using mkfs. You can determine a filesystem’s UUID using either the blkid or the lsblk -f command. Filesystems can be mounted either persistently in the /etc/fstab file using their UUID or temporarily using the -U uuid option on the mount command.

Filed Under: Linux

Some more articles you might also be interested in …

  1. /etc/rsyslog.conf – Setup a Filter to Discard or Redirect Messages
  2. Backtick (`) symbol in Linux Shell Scripting
  3. what does .tar file mean
  4. kill Command Examples in Linux
  5. Configure VSFTPD Chroot Environment in CentOS and RHEL
  6. How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  7. chcpu: command not found
  8. Monitor HDD and SSD with smartd and smartctl
  9. Comparing NET-TOOLS V/s IPROUTE Package Commands (ip Vs ifconfig command comparison)
  10. chcon: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright