前段时间编译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=/",模仿这个写也不对,不知是不是自己编译内核里哪里出现了问题。