0

In this tip we will see how to use the command line to check the name of all connected data storage devices (USB Pen Drives, hard disks, partitions, etc.) to your computer. You may need these commands to know, for example, the correct USB flash drive name that you want to format from the terminal. If incorrect device name is  entered, this could result in data loss, so these command line tools will be very useful.

After connecting your USB device or any other data storage media, start the Ubuntu terminal (Ctrl+Alt+T) and run this command:

sudo fdisk -l

Her are outputs returned for my system:


Disk /dev/sda: 8589 MB, 8589934592 bytes
255 heads, 63 sectors/track, 1044 cylinders, total 16777216 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00034f46


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    14680063     7339008   83  Linux
/dev/sda2        14682110    16775167     1046529    5  Extended
/dev/sda5        14682112    16775167     1046528   82  Linux swap / Solaris


Disk /dev/sdb: 4009 MB, 4009754624 bytes
128 heads, 22 sectors/track, 2781 cylinders, total 7831552 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           8     7831551     3915772    7  HPFS/NTFS/exFAT


This command has also the same function, but with different outputs:

df -h

Outputs returned:


Filesystem           Size  Used    Avail    Use% Mounted on
/dev/sda1             6.9G    5.7G  882M  87%    /
udev                    495M  4.0K   495M   1%     /dev
tmpfs                   201M  780K  200M   1%     /run
none                    5.0M     0       5.0M    0%     /run/lock
none                    502M  144K   501M   1%     /run/shm
/dev/sr0               44M    44M   0          100%  /media/VBOXADDITIONS_4.1.8_75467
/dev/sdb1            3.8G    1.7G    2.2G    44%   /media/B082108982105666



Post a Comment

 
Top