Mount disks with UUID or LABEL
来源:互联网 发布:mac nestopia键位设置 编辑:程序博客网 时间:2024/06/01 22:50
Q: I have a new disk and I would like to mount it on my existing linux install. I can't use the device name (eg. /dev/sda1, /dev/sdb3, etc) because every time I reboot the partitions shuffle around.
A: There are various ways to mount. You can use LABEL or UUID to mount your disks.
Method 1: UUID
A Universally Unique Identifier (UUID) is an identifier standard used in software construction, standardized by the Open Software Foundation (OSF) as part of the Distributed Computing Environment (DCE). The intent of UUIDs is to enable distributed systems to uniquely identify information without significant central coordination.
Finding out UUID for your hard drive:
sudo vol_id -u /dev/hda1
replace hda1 with the partition for which you wish to find the UUIDShould give you something like this:
651a8088-be20-4894-ad93-408881274996
(You can also list UUIDs for all devices using blkid commmand)
Then, all you have to do is edit your /etc/fstab file:
UUID=42aacc5e-2271-4444-aeb2-e6b88a935fb2 /m1 ext3 defaults 0 0
Type sudo mount -a and you should see your new partition. (Note that the hard drive has to be formatted and partitioned before you can mount it)
Method 2: LABELs
Volume labels make it possible for partitions to retain a consistent name regardless of where they are connected, and regardless of whatever else is connected. Labels are not mandatory for a linux volume. Each can be a maximum of 16 characters long.
e2label /dev/hdb1 newlabel
tune2fs -L newlabel /dev/hdb1
mke2fs -L newlabel /dev/hdb1
Once that's done, you can add the disk to your /etc/fstab:
LABEL=newlabel /m2 ext3 defaults 0 0
- Mount disks with UUID or LABEL
- find the uuid for disks
- mount: /dev/sdb already mounted or /sheepdog1 busy(multipath,wwid,uuid,udev)
- Erro mounting..... or mount the volume read-only with the 'ro' mount
- Disks
- mount or unmount
- generate UUID using uuid library or system uuid
- 使用UUID和LABEL挂载磁盘
- Redhat Linux 分区&挂载 LABEL&UUID
- 如何查看Linux系统中的 LABEL/UUID
- Continue With Label Demo
- Problem with label layer
- Label With Placeholder
- Shrink VMWare Virtual Disks formatted with ext4[转]
- Configuring Disks for Automatic Storage Management with ASMLIB
- Corrective Action for Diskgroup with Disks Having PVIDs [ID 750016.1]
- mount device or resource busy
- label or lable 哪个正确?
- Android Studio
- iOS crash log 获取及分析
- JSON.stringify详解
- 搭建音视频播放架构
- 深入浅出机器学习
- Mount disks with UUID or LABEL
- VS2013 完全卸载
- 此篇仅为献给我尊敬的博友!
- ubuntu软件安装
- 邮件失败!javax.mail.AuthenticationFailedException: 535 Error: authentication
- QTimer 的使用
- 一张图让你搞清楚Oracle 数据库的Union和Join
- hibernate5实体映射注解配置注解全面解析
- 微信支付后台通知频率