前段時間編譯linux核心,網上資料都說編譯完後,修改lilo.config,其中有一段配置為:root=/dev/hda2,看我自己的lilo配置,彷彿應該為sda。從網上查了一下hda和sda的差別,把英文論壇上的解釋摘過來。
IDE hard disks (well, devices, actually) are hd<drive><partition>. SCSI devices (and kernel-level emulation of SCSI devices, like USB devices or, in some cases, CD-RW drives) are sd<drive><partition>.
The standard partitioning scheme nowadays is (assuming your drive is hda):
hda1 => bootloader and kernel(s)
hda2 => swap space
hda3 => root filesystem
the way linux asign names to disk drive is as follows:
HD/x/n - now lets break this down;
HD- denotes that the disk drive is IDE based. if the drive SCSI or SATA based it will be designated as SD.
x- denotes the position of the drive. If its installed in the IDE controllers as the Primary Master it will be designated as HDA. If as the Primary Slave it will be designated as HDB. If as the Secondary Master, HDC. HDD if the drive is installed as the Secondary Slave.
n- this denotes the partition number. For example the first partition of the Primary Master will be designated as HDA1. Usually the primary partitions are designated with the numbers 1-4. The logical drives are given the numbers 5-n (depends on how many logical partitions you have.
因為我是在VMWare下裝的linux系統,貌似VMWARE會把虛擬分區虛擬為SCSI裝置,所以覺得我的linux裝置應該為sda才對。
不過,一直搞不明白自己的root那到底該寫什麼才好,不管是用hda還是sda,不管是用hda或sda幾都不能正常啟動,提示為請輸入正確的root=什麼的,貌似是這裡的配置不對。很困惑……
另外,原lilo上的預設配置為:append="root=LABEL=/",模仿這個寫也不對,不知是不是自己編譯核心裡哪裡出現了問題。