Edgy的fstab和grub的变化,使用了UUID

仅供存放个人的配置文件,不要在本版发问。
回复
头像
oneleaf
论坛管理员
帖子: 10207
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04
送出感谢: 7 次
接收感谢: 99 次

Edgy的fstab和grub的变化,使用了UUID

#1

帖子 oneleaf » 2006-10-04 9:52

代码: 全选

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# /dev/sda1 -- converted during upgrade to edgy
UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c / reiserfs defaults 0 1
# /dev/sda3 -- converted during upgrade to edgy
UUID=6b4fad21-6ce4-40d1-9042-f7894420d2ba /boot ext3 defaults 0 2
# /dev/sda4 -- converted during upgrade to edgy
UUID=c9946833-d79a-49d2-a565-2eb5f81b1340 /home reiserfs defaults 0 2
# /dev/sdb1 -- converted during upgrade to edgy
UUID=6884DF8584DF5462 /media/sdb1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
# /dev/sdb2 -- converted during upgrade to edgy
UUID=6f796414-ca8c-467a-8bdf-8690eee8a147 /media/sdb2 xfs defaults 0 2
# /dev/sdb3 -- converted during upgrade to edgy
UUID=4466-DBF1 /media/sdb3 vfat defaults,utf8,umask=007,gid=46 0 1
# /dev/sda2 -- converted during upgrade to edgy
UUID=52fac974-9ebd-4355-8bca-82a8e6763ba3 none swap sw 0 0
/dev/hda        /media/cdrom0   udf,iso9660 user,noauto     0       0




代码: 全选

$ cat /boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
#            grub-install(8), grub-floppy(8),
#            grub-md5-crypt, /usr/share/doc/grub
#            and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default         0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout         10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line)  and entries protected by the
# command 'lock'
# e.g. password topsecret
#      password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title         Windows 95/98/NT/2000
# root          (hd0,0)
# makeactive
# chainloader   +1
#
# title         Linux
# root          (hd0,1)
# kernel        /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
##      kopt_2_6_8=root=/dev/hdc1 ro
##      kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
##      alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
##      lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
##      lockold=true
# lockold=false

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
##      altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
##      howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
##      memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title           Ubuntu, kernel 2.6.17-10-386
root            (hd0,2)
kernel          /vmlinuz-2.6.17-10-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro quiet splash
initrd          /initrd.img-2.6.17-10-386
savedefault
boot

title           Ubuntu, kernel 2.6.17-10-386 (recovery mode)
root            (hd0,2)
kernel          /vmlinuz-2.6.17-10-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro single
initrd          /initrd.img-2.6.17-10-386
boot

title           Ubuntu, kernel 2.6.17-10-generic
root            (hd0,2)
kernel          /vmlinuz-2.6.17-10-generic root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro quiet splash
initrd          /initrd.img-2.6.17-10-generic
savedefault
boot

title           Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root            (hd0,2)
kernel          /vmlinuz-2.6.17-10-generic root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro single
initrd          /initrd.img-2.6.17-10-generic
boot

title           Ubuntu, kernel 2.6.15-27-386
root            (hd0,2)
kernel          /vmlinuz-2.6.15-27-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro quiet splash
initrd          /initrd.img-2.6.15-27-386
savedefault
boot

title           Ubuntu, kernel 2.6.15-27-386 (recovery mode)
root            (hd0,2)
kernel          /vmlinuz-2.6.15-27-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro single
initrd          /initrd.img-2.6.15-27-386
boot

title           Ubuntu, kernel 2.6.15-26-386
root            (hd0,2)
kernel          /vmlinuz-2.6.15-26-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro quiet splash
initrd          /initrd.img-2.6.15-26-386
savedefault
boot

title           Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root            (hd0,2)
kernel          /vmlinuz-2.6.15-26-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro single
initrd          /initrd.img-2.6.15-26-386
boot

title           Ubuntu, kernel 2.6.15-23-386
root            (hd0,2)
kernel          /vmlinuz-2.6.15-23-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro quiet splash
initrd          /initrd.img-2.6.15-23-386
savedefault
boot

title           Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root            (hd0,2)
kernel          /vmlinuz-2.6.15-23-386 root=UUID=d72fd170-80fb-43da-b079-e51cd1a06a7c ro single
initrd          /initrd.img-2.6.15-23-386
boot

title           Ubuntu, memtest86+
root            (hd0,2)
kernel          /memtest86+.bin
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title           Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title           Microsoft Windows XP Professional
root            (hd1,0)
savedefault
makeactive
map             (hd0) (hd1)
map             (hd1) (hd0)
chainloader     +1
qchem
帖子: 106
注册时间: 2005-09-04 21:03
送出感谢: 0
接收感谢: 0

#2

帖子 qchem » 2006-10-04 9:59

那如何才能知道UUID呢?
头像
laborer
帖子: 1016
注册时间: 2005-10-25 11:15
送出感谢: 0
接收感谢: 1 次
联系:

#3

帖子 laborer » 2006-10-04 11:06

qchem 写了:那如何才能知道UUID呢?


代码: 全选

ls -l /dev/disk/by-uuid
hreiser@oakland:~$ killall -9 wife
police@oakland:~$ sudo find / -user hreiser
court@oakland:~$ sudo mv /home/hreiser /jail/
court@oakland:~$ sudo usermod -d /jail/hreiser -s "/usr/sbin/chroot /jail/" hreiser
tjzero
帖子: 78
注册时间: 2005-04-10 22:52
送出感谢: 0
接收感谢: 0

#4

帖子 tjzero » 2006-10-20 17:30

为什么要这样,有什么优点...这样要配置起来可就费劲了
gentoo 2006.1
gnome 2.16.1
star_s
帖子: 24
注册时间: 2006-10-11 19:09
送出感谢: 0
接收感谢: 0

#5

帖子 star_s » 2006-10-20 18:48

I agree!
Why use the UUID?
热爱开源……
头像
oneleaf
论坛管理员
帖子: 10207
注册时间: 2005-03-27 0:06
系统: Ubuntu 12.04
送出感谢: 7 次
接收感谢: 99 次

#6

帖子 oneleaf » 2006-10-20 21:20

每个硬盘驱动器都有一个独特的标志,叫做 UUID。要解决设备名称的变动问题,devlabel 允许你使用用户定义的设备名称来关联这些 UUID。一个符号链接会被创建来连接用户定义的设备名称和实际的设备名称。如果实际的设备名称改变了,这个符号链接会被更新,并根据驱动器的 UUID 来指向同一驱动器。因此,IDE 和 SCSI 贮存设备都可以使用它们的用户定义的名称被引用。

Devlabel 还允许你自动挂载热插入的设备,如可移硬盘和数码照相机的内存卡之类的 USB 设备。如果被配置成自动挂载,设备被插入后,它就会使用用户定义的设备名称被挂载。

http://www.douzhe.com/docs/linux/RHEL3_ ... label.html
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙
送出感谢: 4 次
接收感谢: 256 次

#7

帖子 eexpress » 2006-10-27 19:11

hdax hdbx is clear, UUID is bad
● 鸣学
purewind
帖子: 452
注册时间: 2006-11-18 15:40
送出感谢: 0
接收感谢: 0

#8

帖子 purewind » 2007-01-23 23:52

uuid那么长看着就烦
linux什么最重要?硬件要旧,软件要新!
Ubuntu什么最重要?源要全!网要快!
不是你不明白,是linux变化快
人品也很重要
头像
ptptptptptpt
帖子: 3711
注册时间: 2006-09-19 18:16
送出感谢: 0
接收感谢: 1 次

#9

帖子 ptptptptptpt » 2007-02-15 18:00

我倒挺喜欢UUID,适合我这种成天拿硬盘到处“移动”的人
hujy
帖子: 218
注册时间: 2006-05-25 10:13
来自: 明州
送出感谢: 0
接收感谢: 0

#10

帖子 hujy » 2007-02-15 23:50

这贴子不知怎么的,不能加入收藏夹,提示发生一个错误。
回复

回到 “个人配置文件存放点”