我有一台在 VMware 虚拟机上运行的 Linux 服务器,有 4 个虚拟硬盘。该机器运行一个月后,我在 vSphere 客户端中添加了 4 个硬盘中的 2 个;我需要更多空间。几周前我做了这个步骤,然后被拉到另一个项目中,然后创建文件系统并设置挂载。现在,我不知道 Linux 中的哪个驱动器是哪个。我有 /dev/sda 、 /dev/sda1、 /dev/sda2 和 /dev/sdb
如何确定哪些驱动器有现有数据以及哪些是新数据?或者,如何移除驱动器并重新开始(我知道如何移除 vSphere 客户端中的驱动器,但不知道如何移除 Linux 中对它们的引用)。
以下是dmesg| grep sd
:
[ 1.361162] sd 2:0:0:0: [sda] 16777216 512-byte logical blocks: (8.58 GB/8.00 GiB)
[ 1.361205] sd 2:0:0:0: [sda] Write Protect is off
[ 1.361210] sd 2:0:0:0: [sda] Mode Sense: 61 00 00 00
[ 1.361253] sd 2:0:0:0: [sda] Cache data unavailable
[ 1.361257] sd 2:0:0:0: [sda] Assuming drive cache: write through
[ 1.363223] sd 2:0:0:0: Attached scsi generic sg1 type 0
[ 1.363398] sda: sda1 sda2
[ 1.363788] sd 2:0:0:0: [sda] Attached SCSI disk
[ 1.364425] sd 2:0:1:0: [sdb] 1572864000 512-byte logical blocks: (805 GB/750 GiB)
[ 1.364466] sd 2:0:1:0: [sdb] Write Protect is off
[ 1.364471] sd 2:0:1:0: [sdb] Mode Sense: 61 00 00 00
[ 1.364512] sd 2:0:1:0: [sdb] Cache data unavailable
[ 1.364515] sd 2:0:1:0: [sdb] Assuming drive cache: write through
[ 1.370673] sd 2:0:1:0: Attached scsi generic sg2 type 0
[ 1.405886] sdb: unknown partition table
[ 1.406228] sd 2:0:1:0: [sdb] Attached SCSI disk
[ 4.493214] Installing knfsd (copyright (C) 1996 [email protected]).
[ 4.493849] SELinux: initialized (dev nfsd, type nfsd), uses genfs_contexts
[ 5.933636] EXT4-fs (sdb): mounted filesystem with ordered data mode. Opts: (null)
[ 5.933649] SELinux: initialized (dev sdb, type ext4), uses xattr
[ 6.099670] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 6.108488] SELinux: initialized (dev sda1, type ext4), uses xattr
输出自fdisk -l
Disk /dev/sda: 8 GiB, 8589934592 bytes, 16777216 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x000dfc09
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 1026047 512000 83 Linux
/dev/sda2 1026048 16777215 7875584 8e Linux LVM
Disk /dev/sdb: 750 GiB, 805306368000 bytes, 1572864000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/fedora_dataserv-swap: 820 MiB, 859832320 bytes, 1679360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk /dev/mapper/fedora_dataserv-root: 6.7 GiB, 7201619968 bytes, 14065664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
答案1
根据您提供的信息,您有两个 VM 磁盘:
/dev/sda:8GB,两个分区/dev/sda1和/dev/sda2
/dev/sdb:750GB,无分区,应该是您新添加的分区。
你的fdisk -l命令结果显示您已经创建了一个名为fedora_数据服务根据已使用的磁盘空间,您正在使用/dev/sda仅限磁盘。
您可以参考回答我之前发过帖子,改变deb-web138到fedora_数据服务。 例如:
# vgextend deb-web138 /dev/sdb1
# lvresize -L+70G /dev/deb-web138/root
# resize2fs /dev/deb-web138/root
更改为:
# vgextend fedora_dataserv /dev/sdb1
# lvresize -L+70G /dev/fedora_dataserv/root
# resize2fs /dev/fedora_dataserv/root
以增加您可以使用的空间。
答案2
如果你只是输入
mount
您将看到哪个文件夹被安装到哪个磁盘。
答案3
lsscsi
dmesg| grep sd
cat /proc/scsi/scsi
fdisk -l
答案4
blkid
将列出驱动器。您应该能够根据驱动器的大小、分区、UUID、文件系统类型等来识别它们。lsblk
对于获取设备的图形概览也非常有用,但不显示文件系统类型。