2011
04.27

GRUB4DOS命令界面,输入小写的uuid显示硬盘的UUID信息。如下图。

GRUB4DOS_UUID

GRUB4DOS_UUID

登录ubuntu10.10-desktop-i386系统,在终端命令窗口中输入sudo fdisk -l显示磁盘分区信息。

liunix_org@netmg:~$ sudo fdisk -l
[sudo] password for liunix_org:

Disk /dev/sda: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x969f969f

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1046     8401963+   c  W95 FAT32 (LBA)
/dev/sda2            1047       10444    75483030+   f  W95 Ext’d (LBA)
/dev/sda5            1047        2091     8393931    b  W95 FAT32
/dev/sda6            2092        2335     1952768   83  Linux
/dev/sda7            2335        3550     9764864   83  Linux
/dev/sda8            3551        3915     2928640   83  Linux
/dev/sda9            3915        4645     5858304   83  Linux
/dev/sda10           4645        5860     9764864   83  Linux
/dev/sda11           5861        6104     1951744   82  Linux swap / Solaris
/dev/sda12           6104       10444    34861056   83  Linux
liunix_org@netmg:~$

登录ubuntu10.10-desktop-i386系统,在终端命令窗口中输入ls -Al /dev/disk/by-uuid查看UUID信息。

liunix_org@netmg:~$ ls -Al /dev/disk/by-uuid
总计 0
lrwxrwxrwx 1 root root 10 2011-04-27 08:06 0003-417B -> ../../sda5
lrwxrwxrwx 1 root root 10 2011-04-27 08:06 000C-9A20 -> ../../sda1
lrwxrwxrwx 1 root root 11 2011-04-27 08:06 3cc1ffdf-d8f9-4d70-afe5-80a7e9a6fa42 -> ../../sda12
lrwxrwxrwx 1 root root 10 2011-04-27 08:06 553ddfae-8bc6-4af7-9f9d-dd4a954eed45 -> ../../sda7
lrwxrwxrwx 1 root root 10 2011-04-27 08:06 8d67771f-b515-4482-8340-f85d1c57f4a4 -> ../../sda8
lrwxrwxrwx 1 root root 11 2011-04-27 08:06 9eea7a74-2743-4958-8c57-2766b9e3f736 -> ../../sda10
lrwxrwxrwx 1 root root 11 2011-04-27 08:06 a4d2db56-032e-4afc-b4e9-82f34f8f4c7f -> ../../sda11
lrwxrwxrwx 1 root root 10 2011-04-27 08:06 cb33d846-6749-4c64-a0fd-a4ab3025a7af -> ../../sda6
lrwxrwxrwx 1 root root 10 2011-04-27 08:06 d3f553a1-9248-410b-8a22-568d0fa374ee -> ../../sda9
liunix_org@netmg:~$

 

登录ubuntu10.10-desktop-i386系统,打开/etc/fstab查看UUID信息。

ubuntu_fstab_read_1

ubuntu_fstab_read_1

ubuntu_fstab_read_2

ubuntu_fstab_read_2

# /etc/fstab: static file system information.
#
# Use ‘blkid -o value -s UUID’ to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda12 during installation
UUID=3cc1ffdf-d8f9-4d70-afe5-80a7e9a6fa42 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda6 during installation
UUID=cb33d846-6749-4c64-a0fd-a4ab3025a7af /boot           ext4    defaults        0       2
# /home was on /dev/sda7 during installation
UUID=553ddfae-8bc6-4af7-9f9d-dd4a954eed45 /home           ext4    defaults        0       2
# /liunix.org was on /dev/sda10 during installation
UUID=9eea7a74-2743-4958-8c57-2766b9e3f736 /liunix.org     ext4    defaults        0       2
# /tmp was on /dev/sda8 during installation
UUID=8d67771f-b515-4482-8340-f85d1c57f4a4 /tmp            ext4    defaults        0       2
# /var was on /dev/sda9 during installation
UUID=d3f553a1-9248-410b-8a22-568d0fa374ee /var            ext4    defaults        0       2
# swap was on /dev/sda11 during installation
UUID=a4d2db56-032e-4afc-b4e9-82f34f8f4c7f none            swap    sw              0       0

 

通过GRUB4DOS引导(hd0,0)/ubuntu-10.10-desktop-i386.iso进入安装界面。在这里您可以做到很多事情。

ubuntu_fdisk_list

ubuntu_fdisk_list

通过Applications(应用程序)->Accessories(附件)->Terminal(终端)打开终端命令窗口,输入 sudo fdisk -l 可以显示硬盘的详细分区信息。

ubuntu_get_uuid_1

ubuntu_get_uuid_1

访问以前已安装好的Ubuntu-10.10-desktop-i386系统的/etc目录,找到原/etc/fstab文件。打开原/etc/fstab可以看到详细的UUID信息。

ubuntu_get_uuid_2

ubuntu_get_uuid_2

原创文章,转载请注明: 转载自Liunix.Org

本文链接地址: 获取ubuntu uuid的多种方法

暂无回复

添加回复