“UbuntuHelp:UsingUUID”的版本间的差异
来自Ubuntu中文
小 (新页面: {{From|https://help.ubuntu.com/community/UsingUUID}} {{Languages|UbuntuHelp:UsingUUID}} Since Edgy, Ubuntu requires the use of '''UUID''' or '''LABEL''' (for filesystems including swap),...) |
小 |
||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/UsingUUID}} | {{From|https://help.ubuntu.com/community/UsingUUID}} | ||
{{Languages|UbuntuHelp:UsingUUID}} | {{Languages|UbuntuHelp:UsingUUID}} | ||
− | |||
Since Edgy, Ubuntu requires the use of '''UUID''' or '''LABEL''' (for filesystems including swap), or udev-created symlinks (for removable media like CDROMs and USB drives). Directly using <code><nowiki>/dev/hd*</nowiki></code> or <code><nowiki>/dev/sd*</nowiki></code> is no longer supported (since these device assignments can change from boot to boot): | Since Edgy, Ubuntu requires the use of '''UUID''' or '''LABEL''' (for filesystems including swap), or udev-created symlinks (for removable media like CDROMs and USB drives). Directly using <code><nowiki>/dev/hd*</nowiki></code> or <code><nowiki>/dev/sd*</nowiki></code> is no longer supported (since these device assignments can change from boot to boot): | ||
− | |||
* all filesystems should be specified by <code><nowiki>UUID=</nowiki></code> or <code><nowiki>LABEL=</nowiki></code> | * all filesystems should be specified by <code><nowiki>UUID=</nowiki></code> or <code><nowiki>LABEL=</nowiki></code> | ||
* all physical devices should be specified by a symlink (e.g. <code><nowiki>/dev/cdrom</nowiki></code>, <code><nowiki>/dev/disk/by-id/...</nowiki></code>, etc.) | * all physical devices should be specified by a symlink (e.g. <code><nowiki>/dev/cdrom</nowiki></code>, <code><nowiki>/dev/disk/by-id/...</nowiki></code>, etc.) | ||
− | |||
The files for which this is most critical are: | The files for which this is most critical are: | ||
* <code><nowiki>/boot/grub/menu.lst</nowiki></code> | * <code><nowiki>/boot/grub/menu.lst</nowiki></code> | ||
* <code><nowiki>/etc/fstab</nowiki></code> | * <code><nowiki>/etc/fstab</nowiki></code> | ||
* <code><nowiki>/etc/initramfs-tools/conf.d/resume</nowiki></code> | * <code><nowiki>/etc/initramfs-tools/conf.d/resume</nowiki></code> | ||
− | |||
==== Finding ==== | ==== Finding ==== | ||
− | |||
UUIDs can be determined using the <code><nowiki>vol_id</nowiki></code> command. For example, to find the UUID for the filesystem on <code><nowiki>/dev/sda1</nowiki></code>: | UUIDs can be determined using the <code><nowiki>vol_id</nowiki></code> command. For example, to find the UUID for the filesystem on <code><nowiki>/dev/sda1</nowiki></code>: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
$ sudo /sbin/vol_id -u /dev/sda1 | $ sudo /sbin/vol_id -u /dev/sda1 | ||
79415992-7093-4a0e-a2e5-4574ed702d05 | 79415992-7093-4a0e-a2e5-4574ed702d05 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Symlinks created by udev can be found by searching for the target device in <code><nowiki>/dev</nowiki></code>. For example, to find <code><nowiki>/dev/sda1</nowiki></code>: | Symlinks created by udev can be found by searching for the target device in <code><nowiki>/dev</nowiki></code>. For example, to find <code><nowiki>/dev/sda1</nowiki></code>: | ||
− | |||
<pre><nowiki> | <pre><nowiki> | ||
$ ls -la /dev/disk/by-id | grep /sda1$ | $ ls -la /dev/disk/by-id | grep /sda1$ | ||
第28行: | 第20行: | ||
lrwxrwxrwx 1 root root 10 8207-06-10 02:46 scsi-1ATA_ST2250823AS_3ND277BL-part1 -> ../../sda1 | lrwxrwxrwx 1 root root 10 8207-06-10 02:46 scsi-1ATA_ST2250823AS_3ND277BL-part1 -> ../../sda1 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
==== Converting ==== | ==== Converting ==== | ||
− | |||
To perform these UUID lookups and corrections automatically (which should have already happened during the Dapper to Edgy upgrade) please use: | To perform these UUID lookups and corrections automatically (which should have already happened during the Dapper to Edgy upgrade) please use: | ||
− | |||
* For <code><nowiki>/boot/grub/menu.lst</nowiki></code>: | * For <code><nowiki>/boot/grub/menu.lst</nowiki></code>: | ||
<pre><nowiki> | <pre><nowiki> |
2007年11月30日 (五) 22:05的版本
Since Edgy, Ubuntu requires the use of UUID or LABEL (for filesystems including swap), or udev-created symlinks (for removable media like CDROMs and USB drives). Directly using /dev/hd*
or /dev/sd*
is no longer supported (since these device assignments can change from boot to boot):
- all filesystems should be specified by
UUID=
orLABEL=
- all physical devices should be specified by a symlink (e.g.
/dev/cdrom
,/dev/disk/by-id/...
, etc.)
The files for which this is most critical are:
-
/boot/grub/menu.lst
-
/etc/fstab
-
/etc/initramfs-tools/conf.d/resume
Finding
UUIDs can be determined using the vol_id
command. For example, to find the UUID for the filesystem on /dev/sda1
:
$ sudo /sbin/vol_id -u /dev/sda1 79415992-7093-4a0e-a2e5-4574ed702d05
Symlinks created by udev can be found by searching for the target device in /dev
. For example, to find /dev/sda1
:
$ ls -la /dev/disk/by-id | grep /sda1$ lrwxrwxrwx 1 root root 10 8207-06-10 02:46 ata-ST2250823AS_3ND277BL-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 8207-06-10 02:46 scsi-1ATA_ST2250823AS_3ND277BL-part1 -> ../../sda1
Converting
To perform these UUID lookups and corrections automatically (which should have already happened during the Dapper to Edgy upgrade) please use:
- For
/boot/grub/menu.lst
:
sudo update-grub
- For
/etc/fstab
:
sudo rm -f /etc/fstab.pre-uuid sudo /var/lib/dpkg/info/volumeid.postinst configure
- For
/etc/initramfs-tools/conf.d/resume
, there is no automatic procedure:- Verify that
RESUME=
matches yourswap
line in/etc/fstab
- After any adjustment, run
sudo update-initramfs -u
- Verify that