If you plug it in again and run the command, the device will be there. If you unplug it and run that command again, you'll see the device has been removed. The most recent drive listed is the one you just plugged in. For instance, if you want to make sure a thumb drive is really /dev/sdc, plug the drive into your computer and run this dmesg command: $ sudo dmesg | tail If in doubt, you can test device label assignments by looking at the tail end of the dmesg command, which displays recent system log entries including kernel events (such as attaching and detaching a drive). The lsblk command is nondestructive and used only for probing, so you can run it without any fear of ruining data on a drive. If you're not sure what a partition is, that's OK-just keep reading. For example, the second partition of the first drive is sda2. Each partition of each drive is assigned a number, starting with 1. The device identifiers are listed in the left column, each beginning with sd, and ending with a letter, starting with a. The easy way to list the block devices attached to your Linux system is to use the lsblk (list block devices) command: $ lsblk This differentiates a hard drive from anything else you might plug into your computer, like a printer, gamepad, microphone, or camera. What are block devices?Ī hard drive is generically referred to as a "block device" because hard drives read and write data in fixed-size blocks. For those times, you need to know how to find and prepare a storage device connected to your machine. Sometimes, however, a drive isn't set up the way you want. It's a simple requirement and one that the computer generally fulfills. If the drive is already partitioned and formatted to your liking, you just need your computer to list the drive somewhere in your file manager window or on your desktop. On most computer systems, Linux or otherwise, when you plug a USB thumb drive in, you're alerted that the drive exists.
0 Comments
Leave a Reply. |