Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GNU GRUB
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Identifying partitions (UUID workaround) === A computer can have multiple hard disks connected to it. These could be identified via their SATA port. Each time the computer [[Power-on self-test|POSTs]], the hard disk connected to a specific motherboard port ''could'' be assigned the same identifier, for example {{code|hd0, hd1, β¦}}. But what if such consistency cannot be guaranteed? What if the constellation of connected hard disks changed from one start up to another? What if a hard disk will be connected to another computer? By entering {{code|ls}} into either the ''GRUB rescue console'' (available after loading <code>core.img</code> ) or the ''GRUB console'' (available after loading <code>normal.mod</code>) a list of all available hard disks and partitions can be obtained. For example, {{code|ls (hd0,5)/}}) will show numbers that can be assigned to actual hard disks and partitions. As it cannot be guaranteed that the "<code>hd0"</code>style numbering of hard disks via device numbers is consistent, GNU GRUB can use a [[Universally Unique Identifier]] (UUID) to identify partitions (actually file system instances). The file systems ext2, ext3, ext4 and xfs use a UUID to uniquely identify an instance. The UUID is created when a partition is formatted. The UUID is part of the file system and written to the [[Superblock (file system)|superblock]]. All operations other than formatting should leave the UUID unaltered. It is possible to change the UUID or duplicate it by using [[dd (Unix)|dd]] to clone an entire partition. The file {{code|grub.cfg}} is used to configure GRUB. It contains commands to be executed during each start-up. Without an existing and valid {{code|grub.cfg}}, GRUB will present a prompt. An absolute minimal {{code|grub.cfg}} might contain only the following two commands (cf. [[initial ramdisk]]): <pre> linux (hd0,1)/kernel/vmlinuz-3.20.1-4 ro # use the file name "vmlinuz-β¦" located in the directory /kernel on the first partition of the first hard disk as linux kernel image initrd (hd0,1)/boot/initrd.img-3.20.1-4 # use the file named "initrd.imgββ¦" located in the directory /boot on the first partition of the first hard disk as initial ramdisk </pre> A fancier {{code|grub.cfg}} will describe a menu to be presented, use multiple colors, and may specify a background picture.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)