我的联想笔记本电脑运行 Kubuntu(没有双启动,只有 Kubuntu),存储空间一直很紧张。我一直以为我有 233 GB 的可用存储空间。
但是昨天,我打开笔记本电脑升级 RAM,发现里面的 HDD 是 1 TB。
因此,我运行了以下命令,果然,操作系统看到了该硬盘:
sudo fdisk -l
结果如下:(删除所有 snap loop 卷后)
Disk /dev/nvme0n1: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: LENSE30256GMSP34MEAT3TA
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: gpt
Disk identifier: 3235924C-672D-45A7-AFC1-A0EF35F3F7AE
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 500117503 499066880 238G Linux LVM
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM035-1RK1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk /dev/mapper/kubuntu--vg-root: 236.102 GiB, 254472617984 bytes, 497016832 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/kubuntu--vg-swap_1: 976 MiB, 1023410176 bytes, 1998848 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
结果sudo df -h
如下:(再次删除 snap 的 loop volumes 之后)
Filesystem Size Used Avail Use% Mounted on
udev 16G 0 16G 0% /dev
tmpfs 3.2G 1.8M 3.2G 1% /run
/dev/mapper/kubuntu--vg-root 233G 200G 21G 91% /
tmpfs 16G 139M 16G 1% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/nvme0n1p1 511M 7.8M 504M 2% /boot/efi
tmpfs 3.2G 20K 3.2G 1% /run/user/1000
我"KDE Partition Manager"
还可以看到 1 TB 卷,并且可以在其上创建新的分区表。问题是,如果我这样做,我担心会丢失所有数据和配置。
我的问题是,如何扩展我的根卷以便可以使用整个硬盘?
以下是 3 张截图"KDE Partition Manager"
答案1
我在你的输出中看到两个硬件项目:
这是您的 SSD,其中包含您的 Ubuntu 系统:
Disk /dev/nvme0n1: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: LENSE30256GMSP34MEAT3TA
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: gpt
Disk identifier: 3235924C-672D-45A7-AFC1-A0EF35F3F7AE
Device Start End Sectors Size Type
/dev/nvme0n1p1 2048 1050623 1048576 512M EFI System
/dev/nvme0n1p2 1050624 500117503 499066880 238G Linux LVM
这是另一个,似乎未分区并且未使用:
Disk /dev/sda: 931.53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST1000LM035-1RK1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
建议:对硬盘进行分区并开始使用它。