vfs

http://unix.stackexchange.com/questions/93767/why-cant-i-specify-my-root-fs-with-a-uuid

blkid

partuuid=009009-09

(uuid是需要initramfs中的驱动的,没有的话它认识partuuid,very nice)

The parameter you have to pass to boot from UUID is PARTUUID. So it should be root=PARTUUID=666c2eee-193d-42db-a490-4c444342bd4e.

The documentation explains why it's coming back with unknown-block(0,0):

kernel-parameters.txt:

    root=       [KNL] Root filesystem
            See name_to_dev_t comment in init/do_mounts.c.

init/do_mounts.c:

/*
 *  Convert a name into device number.  We accept the following variants:
 *
 *  1) device number in hexadecimal represents itself
 *  2) /dev/nfs represents Root_NFS (0xff)
 *  3) /dev/<disk_name> represents the device number of disk
 *  4) /dev/<disk_name><decimal> represents the device number
 *         of partition - device number of disk plus the partition number
 *  5) /dev/<disk_name>p<decimal> - same as the above, that form is
 *     used when disk name of partitioned disk ends on a digit.
 *  6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
 *     unique id of a partition if the partition table provides it.
 *     The UUID may be either an EFI/GPT UUID, or refer to an MSDOS
 *     partition using the format SSSSSSSS-PP, where SSSSSSSS is a zero-
 *     filled hex representation of the 32-bit "NT disk signature", and PP
 *     is a zero-filled hex representation of the 1-based partition number.
 *  7) PARTUUID=<UUID>/PARTNROFF=<int> to select a partition in relation to
 *     a partition with a known unique id.
 *
 *  If name doesn't have fall into the categories above, we return (0,0).
 *  block_class is used to check if something is a disk name. If the disk
 *  name contains slashes, the device name has them replaced with
 *  bangs.
 */

The last bit at the end says that if it cant understand the value, it returns (0,0), hence your error.

shareimprove this answer
 
    
This is only partially correct. A partition UUID is completely different from the filesystem's UUID, so PARTUUID=666c2eee-193d-42db-a490-4c444342bd4e does not work. However, I was able to use PARTUUID=SSSSSSSS-02 (where SSSSSSSS is the NT disk signature shown just before the error message). – cjm Oct 6 '13 at 5:42
3  
So I guess that the real answer is that the kernel does not support root=UUID, only root=PARTUUID. If you want to use a filesystem UUID, I guess you need an initramfs that can handle mounting filesystems by UUID. – cjm Oct 6 '13 at 5:48
    
@cjm my grub boots quite happily with root=UUID. – terdon Oct 6 '13 at 14:30
1  
@terdon, I'll bet you have an initramfs or initrd. (It could be linked into your kernel instead of being a separate file.) – cjm Oct 6 '13 at 14:59

Just to clarify UUIDs are the only reliable way for the kernel to identify hard drives. There are two types: UUID, which is stored in the filesystem and is not available to the kernel at boot-time, and PARTUUID, which is stored in the partition table and IS available at boot time. So you have to use

root=PARTUUID=SSSSSSSS-PP

as /dev/sd?? can change with devices plugged/unplugged.

Don't forget to capitalize the hexadecimal number SSSSSSSS-PP you get from blkid!

The more easy to use

root=LABEL=
root=UUID=

only work with an initramfs that fetches these identifiers.

So, if you use a non-empty initramfs, you can have all three! With an empty initramfs, you only have PARTUUID.

shareimprove this answer
 
    
Mind to explain who is using the boot=-argument then? I just used this line for an Archlinuxarm installation that doesn't have initrd, and where I can't use boot=LABEL nor boot=UUID. – ineiti Aug 21 '14 at 22:48
    
You're right - I corrected the boot to root, sorry! Hope it makes more sense now. – ineiti Aug 21 '14 at 22:57
    
Yes. The kernel will interpret a root= flag - but not in the sense i think you mean. There is no such thing as without initramfs - the root= flag points to an initramfs image which the kernel will extract into its own / with cpio. initrd is extinct - and has been since the 2.6 kernel was introduced. – mikeserv Aug 21 '14 at 23:01
    
My understanding (after one day on the forums of archlinuxarm) is that there is no initrd (or initramfs, but kernel.org/doc/Documentation/kernel-parameters.txt calls it initrd) on Archlinuxarm. On Ubuntu and such I do give a pointer to initrd, but (as to my understanding) not on Archlinuxarm. – ineiti Aug 22 '14 at 6:54
    
Archlinuxarm discussion about NO initrd: archlinuxarm.org/forum/viewtopic.php?f=23&t=6652 – ineiti Aug 22 '14 at 7:18
原文地址:https://www.cnblogs.com/jvava/p/4907609.html