注意:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Successful booting with UUID

From Funtoo
Revision as of 20:12, May 26, 2019 by Dutch-master (talk | contribs)
Jump to navigation Jump to search

Guide to use UUID for consistent booting.

Guide to use UUID for consistent booting.
   Support Funtoo!
Get an awesome Funtoo container and support Funtoo! See Funtoo Containers for more information.


Introduction

When your system boots, the kernel looks at the fstab file to learn which partitions are available and where these should be mounted in the tree. Since the dawn of time, Unix time anyway, the convention was to list each partition from /dev. This works quite alright if you have only a single disk in your system, but modern computers, servers included, have an increasing amount of disks connected to their hardware and with that, the chance of 'getting it wrong' increases significantly. The result is a kernel panic! Fortunately, Linux has a solution: UUID or Unified Universal IDentification. It works this way: each time a partition is created, the partitioning tool also creates a random, large, unique number for it and assigns this to the partition. Due to its size, it's highly unlikely another partition in the machine will have the exact same number assigned to it. By using this UUID number in fstab the kernel can locate the correct partition to mount in the tree at the correct place and do so consistently. So, it's a good idea to use this UUID stuff, right? But how? Well, that's exactly the purpose of this guide.

Preparing your system

As is common in Linux, everything is a file (except for networking stuff, but that's beyond the scope of this guide) and so is the /etc/fstab file. To be safe, copy the contents of this file to a backup location.

cp /etc/fstab /etc/fstab.bak

Next, obtain the UUID's of each partition in your system. For that, we have the blkid command:

blkid /dev/sd* >> /etc/fstab

<more to come>



   Note

Browse all our available articles below. Use the search field to search for topics and keywords in real-time.

Article Subtitle
Article Subtitle
Awk by Example, Part 1 An intro to the great language with the strange name
Awk by Example, Part 2 Records, loops, and arrays
Awk by Example, Part 3 String functions and ... checkbooks?
Bash by Example, Part 1 Fundamental programming in the Bourne again shell (bash)
Bash by Example, Part 2 More bash programming fundamentals
Bash by Example, Part 3 Exploring the ebuild system
BTRFS Fun
Funtoo Filesystem Guide, Part 1 Journaling and ReiserFS
Funtoo Filesystem Guide, Part 2 Using ReiserFS and Linux
Funtoo Filesystem Guide, Part 3 Tmpfs and Bind Mounts
Funtoo Filesystem Guide, Part 4 Introducing Ext3
Funtoo Filesystem Guide, Part 5 Ext3 in Action
GUID Booting Guide
Learning Linux LVM, Part 1 Storage management magic with Logical Volume Management
Learning Linux LVM, Part 2 The cvs.gentoo.org upgrade
Libvirt
Linux Fundamentals, Part 1
Linux Fundamentals, Part 2
Linux Fundamentals, Part 3
Linux Fundamentals, Part 4
LVM Fun
Making the Distribution, Part 1
Making the Distribution, Part 2
Making the Distribution, Part 3
Maximum Swappage Getting the most out of swap
On screen annotation Write on top of apps on your screen
OpenSSH Key Management, Part 1 Understanding RSA/DSA Authentication
OpenSSH Key Management, Part 2 Introducing ssh-agent and keychain
OpenSSH Key Management, Part 3 Agent Forwarding
Partition Planning Tips Keeping things organized on disk
Partitioning in Action, Part 1 Moving /home
Partitioning in Action, Part 2 Consolidating data
POSIX Threads Explained, Part 1 A simple and nimble tool for memory sharing
POSIX Threads Explained, Part 2
POSIX Threads Explained, Part 3 Improve efficiency with condition variables
Sed by Example, Part 1
Sed by Example, Part 2
Sed by Example, Part 3
Successful booting with UUID Guide to use UUID for consistent booting.
The Gentoo.org Redesign, Part 1 A site reborn
The Gentoo.org Redesign, Part 2 The Documentation System
The Gentoo.org Redesign, Part 3 The New Main Pages
The Gentoo.org Redesign, Part 4 The Final Touch of XML
Traffic Control
Windows 10 Virtualization with KVM