After the hard disk is partitioned, reset the hard disk table in linux.
Source: Internet
Author: User
After the hard disk is partitioned, reset the hard disk table in linux-general Linux technology-Linux technology and application information. For more information, see the following. The uuid changes after the hard disk is partitioned, causing an error in mounting the hard disk in linux.
----- What is uuid?
UUID, full name: Universally Unique Identifier
It is a 128-bit, 16-byte value and must be unique in time and space. It combines the hardware address, time, and random number to ensure its uniqueness. Generally, the generation algorithm is generated using the IP address of the computer Nic and a 60-bit timestamp. The time interval is 100ns. For example, for a 6862 PL computer, the MAC address of the NIC integrated with the motherboard is 00-04-AC-2E-B7-DC, And the last six bytes of the UUID will be 0004AC2EB7DC.
The uuid changes after the hard disk partition is adjusted.
----- Check the uuid ls-l/dev/disk/by-uuid corresponding to each partition
----- Modify the uuid Allocation Table sudo vi/etc/fstab in linux
Ubuntu now uses the UUID value to represent hard disk partitions by default. in/etc/fstab, we can easily see:
This representation is also available in the GRUB startup Item.
Kernel/boot/vmlinuz-2.6.20-14-generic root = UUID = 6286feb3-3037-4893-b0f1-8c9edba3c447 ro
Quiet splash locale = zh_CN
Compared with the previous use of hda *, the advantage of using UUID is that as long as the partition size is not adjusted, its UUID value is fixed, that is, even if all other partitions are deleted, does not affect the mounting of this partition.
So what if the partition changes? Sometimes you need to adjust the partition size so that its UUID value changes. In this case, you need to change the UUID value of the partition to the current value in/etc/fstab; otherwise, the partition cannot be automatically mounted.
To query the UUID value of a partition, run the following command:
Ls-al/dev/disk/by-uuid
This is the UUID of my hard disk partition. It can be seen that after sda5 is adjusted, the UUID changes and the corresponding part of fstab is deleted. OK
----- Parameters of Various Hard Disk formats are as follows:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.