安装磁盘时出现问题

安装磁盘时出现问题
[root@localhost ~]# fdisk -l

Disk /dev/xvdb: 2147.5 GB, 2147483648000 bytes
255 heads, 63 sectors/track, 261083 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: 0x00050ec0

    Device Boot      Start         End      Blocks   Id  System
/dev/xvdb1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvdb2              64      261084  2096638976   8e  Linux LVM

Disk /dev/xvda: 5368 MB, 5368709120 bytes
255 heads, 63 sectors/track, 652 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: 0x000effaf

    Device Boot      Start         End      Blocks   Id  System
/dev/xvda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2              64         653     4729856   8e  Linux LVM
Partition 2 does not end on cylinder boundary.

Disk /dev/mapper/VolGroup-lv_swap: 16.8 GB, 16844324864 bytes
255 heads, 63 sectors/track, 2047 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: 0x00000000


Disk /dev/mapper/VolGroup00-lv_root: 4303 MB, 4303355904 bytes
255 heads, 63 sectors/track, 523 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: 0x00000000


Disk /dev/mapper/VolGroup00-lv_swap: 536 MB, 536870912 bytes
255 heads, 63 sectors/track, 65 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: 0x00000000


Disk /dev/mapper/VolGroup-lv_root: 53.7 GB, 53687091200 bytes
255 heads, 63 sectors/track, 6527 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: 0x00000000


Disk /dev/mapper/VolGroup-lv_home: 2076.4 GB, 2076423749632 bytes
255 heads, 63 sectors/track, 252444 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: 0x00000000

[root@localhost ~]#

安装驱动器

[root@localhost ~]# df
Filesystem           1K-blocks   Used Available Use% Mounted on
/dev/mapper/VolGroup00-lv_root
                       4005360 780156   3015080  21% /
tmpfs                  1475396      0   1475396   0% /dev/shm
/dev/xvda1              487652  52811    409241  12% /boot
[root@localhost ~]#

XenServer 连接的驱动器的屏幕截图

硬盘驱动器

如何将此驱动器连接到 2TB 硬盘/mnt/?我以为mount -t ext2 /dev/xvdb /mnt会成功,但我尝试的一切都失败了

/etc/fstab

#
# /etc/fstab
# Created by anaconda on Sun Aug 23 19:29:26 2015
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/VolGroup00-lv_root /                       ext4    defaults        1 1
UUID=b9b08863-9a52-432a-b904-61a3144ce709 /boot                   ext4    defaults        1 2
/dev/mapper/VolGroup-lv_swap swap                    swap    defaults        0 0
/dev/mapper/VolGroup00-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0

已安装的驱动器

[root@localhost ~]# mount
/dev/mapper/VolGroup00-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/xvda1 on /boot type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)

uuid

[root@localhost ~]# ls -l /dev/disk/by-uuid
total 0
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 31de66c0-cd8f-4f75-9bf6-7194dc43dafd -> ../../dm-4
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 35a57414-2271-4db2-9f9a-09cf36c19044 -> ../../dm-0
lrwxrwxrwx. 1 root root 11 Aug 23 21:37 5a99aec9-7270-44ce-9df7-32ff4d70a75b -> ../../xvdb1
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 986339d2-abd7-453f-8422-e8c1acb9368a -> ../../dm-2
lrwxrwxrwx. 1 root root 11 Aug 23 21:37 b9b08863-9a52-432a-b904-61a3144ce709 -> ../../xvda1
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 c065a889-055d-44f2-bae4-0ac73d86d493 -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Aug 23 21:37 e85cb70e-6403-4b06-a481-a1512140a491 -> ../../dm-3

答案1

您的命令正在尝试挂载设备,而不是分区。

而不是mount -t ext2 /dev/xvdb /mnt,请尝试使用:

mount -t ext4 /dev/xvdb2 /mnt

如果您想在启动时自动挂载此分区,您还需要将该分区添加到 fstab 文件中。

您需要知道磁盘的 UUID,可以使用 找到它ls -l /dev/disk/by-uuid/,然后查找 2TB 驱动器。您的磁盘似乎是 5a99aec9-7270-44ce-9df7-32ff4d70a75b。

然后您需要编辑/etc/fstab并添加以下行:

UUID=5a99aec9-7270-44ce-9df7-32ff4d70a75b /mnt ext4 defaults 1 2

这里有 Ubuntu 的综合指南:https://help.ubuntu.com/community/AutomaticallyMountPartitions

相关内容