Linux and Grub view each partition device name __linux

Source: Internet
Author: User
Tags disk usage
Many times we use names such as (hd0,1), (hd0,2), sda1, Sda2, and so on, but what exactly are these things and where do you see them? Below I will say my personal understanding:

About the naming of partition devices under Linux

SDA (/DEV/SDA) refers to the first hard disk itself (SATA drives are represented by SDA, while IDE drives are represented by HDA)

SDA1 represents the first hard drive 1th primary partition (where the extended partition is viewed as the primary partition)

Sda2 represents the first hard drive 2nd primary partition

Sda3 represents the first hard drive 3rd primary partition

SDA4 represents the first hard drive 4th primary partition

SDA5 represents the first hard drive 1th logical partition

Sda6 represents the first hard drive 2nd logical partition

And so on ... (if the second hard drive is represented as SDB\HDB)

Because SDA, HDA and other names are Linux under the notation, so want to see, Linux can be viewed under the command: sudo fdisk-l, there are many online on the Linux view of the partition device, a lot of search, so I do not say more. Lazy to find words, I recommend Baidu Library six methods to view the Linux hard disk usage point here

About the name of the grub partition device

In addition, the first hard drive of the system is represented by (hd0), and the first partition on it is represented by (hd0,0), which means that for the hard disk, the x and Y are counted from 0, X is the hard drive number, and Y represents the area code. Since there can only be four primary partitions, four primary partitions of the first hard disk are represented by (hd0,0) ~ (hd0,3), and logical partitions are calculated from (hd0,4), i.e. first logical partitions (hd0,4), second logical partitions (hd0,5), and so on. The hard disk of a general machine is a primary partition and the rest is a logical partition. So C disk (hd0,0), D disk (hd0,4) to express. The CD is used (CD) to indicate the first floppy drive (FD0).


If my hard disk has two primary partitions, the rest are logical partitions. The following diagram is represented by a (Hdx,y) method:



If you are unsure of the grub partition that corresponds to your hard disk partition, you can use the LS command under Grub to view the files under the partition to determine:

LS lists all of the current devices. such as (hd0,0), (hd0,1), (hd0,5), (hd0,6), etc.

LS-L lists all current devices in detail. For partitions, their label and UUID are displayed.

LS (hd0,1)/list (hd0,1) all files under the root directory of the partition.

So if you're not sure, use LS to list all the current devices, and use LS (hd0,x)/command to determine. (x needs to be changed on a per-partition basis)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.