个人工具
登录
查看“UbuntuHelp:UsingUUID”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:UsingUUID”的源代码
来自Ubuntu中文
←
UbuntuHelp:UsingUUID
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/UsingUUID}} {{Languages|UbuntuHelp:UsingUUID}} Since Edgy, Ubuntu requires the use of '''UUID''' (Universally Unique Identifier) 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 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: * <code><nowiki>/boot/grub/menu.lst</nowiki></code> * <code><nowiki>/etc/fstab</nowiki></code> * <code><nowiki>/etc/initramfs-tools/conf.d/resume</nowiki></code> ==== 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>: <pre><nowiki> $ sudo /sbin/vol_id -u /dev/sda1 79415992-7093-4a0e-a2e5-4574ed702d05 </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>: <pre><nowiki> $ 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 </nowiki></pre> ==== Converting ==== 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>: <pre><nowiki> sudo update-grub </nowiki></pre> * For <code><nowiki>/etc/fstab</nowiki></code>: <pre><nowiki> sudo rm -f /etc/fstab.pre-uuid sudo /var/lib/dpkg/info/volumeid.postinst configure </nowiki></pre> * For <code><nowiki>/etc/initramfs-tools/conf.d/resume</nowiki></code>, there is no automatic procedure: * Verify that <code><nowiki>RESUME=</nowiki></code> matches your <code><nowiki>swap</nowiki></code> line in <code><nowiki>/etc/fstab</nowiki></code> * After any adjustment, run <code><nowiki>sudo update-initramfs -u</nowiki></code> [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:UsingUUID
。