How do I get a list of drives connected to my Linux system?

If you're trying to get a list of drives connected to your Ubuntu, or any Linux system, for that matter, it's a pretty simple task.

From a command line, you simply type the following command and hit <Enter>:

    lsblk



There are also many other options available to you if you want to display other information or alternately you may need to output drive information in a format to allow you to control it with automation.

For example, lsblk -f will output information about the filesystem.







Flags such as -J which outputs JSON formatted drive information can be handy to incorporate in scripting if you're using remote code execution and automation tools to automate processes for management of your servers.


As always with any Linux distro, should you need to delve into the really deep end to get more than just basic information, people often forget to refer to their friendly man pages when searching for answers.

If you're looking for answers for any specific command and you already know that command, such as looking for information about the lsblk command, you'd simply type:

    man lsblk








Name

false
ltr
static_page
Tech Lab: How do I get a list of drives connected to my Linux system?
How do I get a list of drives connected to my Linux system?
Tech Lab
https://techlab.connektiv8.com/p/how-do-i-get-list-of-drives-connected.html
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/p/how-do-i-get-list-of-drives-connected.html
true
5093225316588518036
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network