使用fdisk -lu 命令没有显示分区起始位置
为何出现该情况/dev/vdb 跟 /dev/vdb1 是不同的,可以通过 man fdisk 命令阅读手册。根据手册解释,DEVICES The device is usually /dev/sda, /dev/sdb or so. A device name refers to the entire disk. Old systems without libata (a library used inside the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks. In such cases the device name will be /dev/hd* (IDE) or /dev/sd* (SCSI). The partition is a device name followed by a partition number. For example, /dev/sda1 is the first partition on the first hard disk in the system. See also Linux kernel documentation (the Documentation/devices.txt file).前者是 device,后者是 partition。fdisk 命令只有在接受 device 为参数的情况下,才能看到完整的 partition table。所以正确的命令是 fdisk -lu /dev/vda 。能否查询到分区起始位置使用正确的命令fdisk -lu /dev/vda 进行查看。能否在没有该信息情况下进行操作其实是可以的。查看分区起始位置只是为了确认当前的分区情况。本身不影响后续分区扩展操作。但是若进行分区的操作也将 /dev/vda 误输入成 /dev/vda1 则会有不符合预期的结果。所以请输入正确的命令fdisk -u /dev/vda 进入交互式操作。
赞0
踩0