Skip to main content
  1. Archives/

[How-To] Display A List of All Partitions, Device Info and Filesystem Type In Linux

··289 words·2 mins·
Tips & How-To's Commands Linux

In my previous posts I’d written on how to mount your partitions using the mount command. In the post I’d mentioned that you’d have to mention the partition that you want to mount by specifying /dev/device_name as part of the command. The question that would come to your mind is, How do I know which of my partition is on what device? So let me show how to find out which partition is on what device! Like quite a lot of my posts, this involves the Command prompt - my preferred way of doing. Open the Terminal. Switch to root user by typing

su root. For those distros whose root accounts are disabled(Like Ubuntu) just prefix sudo. Type fdisk -l This is what you’ll get

[root@shaman]# fdisk -l`

Disk /dev/sda: 160.0 GB, 160041885696 bytes
  
255 heads, 63 sectors/track, 19457 cylinders
  
Units = cylinders of 16065 * 512 = 8225280 bytes
  
Disk identifier: 0x0004ed56

Device Boot      Start         End      Blocks   Id  System
  
/dev/sda1               1          10       80293+  83  Linux
  
/dev/sda2   *          11       15091   121135645+   7  HPFS/NTFS
  
Partition 2 does not end on cylinder boundary.
  
/dev/sda3           15091       17455    18991317   8e  Linux LVM
  
/dev/sda4           17456       19456    16073032+   f  W95 Ext'd (LBA)
  
/dev/sda5           17456       19456    16073001    7  HPFS/NTFS

The ones to note are Device, and System, the others can be ignored. Device indicates which device the particular filesystem is available at, and System indicates the filesystem type. In my case, /dev/sda1 is a Linux boot partition. My First Windows/NTFS drive(ie, Drive C) is available on /dev/sda2. /dev/sda3 is my Linux partition[configured as a LVM, will cover LVM on a future article] and my second NTFS partition is on /dev/sda4. So now I know which partition is available where, and I can go ahead with mounting.

Sathyajith Bhat
Author
Sathyajith Bhat
Author, AWS Container Hero and DevOps Specialist.

Related

[How To]Setup a BSNL DataOne BroadBand connection or a DSL Connection in Linux
··431 words·3 mins
Tips & How-To's Commands Linux Tutorials
Remember that all these assumes that your router is connected to the LAN port, if it’s connected to the USB port, then disconnect it and connect to the LAN port. If you dont have a LAN card, then consider getting one. It’s cheap, costs around Rs. 200. Next, it’s best to have the router configured in pppoe mode. In this case you just have to switch on the router, the router and DHCP will take care of the rest.
[How-To]Mounting LVM partitions from a command prompt or a Root Shell
··404 words·2 mins
Tips & How-To's Commands Linux
Today as I booted into my openSUSE box, for reasons unknown to me, my LVM partitions failed to mount. fsck didn’t help, and and LVM based container system meant that I couldn’t use the standard mount /dev/sdxx style of mounting as well. With my /home and / configured as a LVM, the root (/) partition was active, but the /home partition was not being mounted, as a result, X and KDM wouldn’t start, giving a console login.
A Handy Wallpaper Displaying Most Common Linux Commands
··27 words·1 min
Tips & How-To's Commands Linux
In the past I’ve done couple of posts explaining few of the common commands. A handy one-glance reference guide is always nice, and found this on Reddit.