如何扩展Linux与Windows双启动分区?扩展分区后如何重建Grub?

如何扩展Linux与Windows双启动分区?扩展分区后如何重建Grub?

我有双启动Linux(Kali Linux)和Windows,由于Linux存储空间不足,我想缩小Windows分区并扩展Linux分区

我知道有很多关于此的帖子,我已经检查了其中的大多数,但就我而言,我必须从起始扇区扩展 Linux 分区(/dev/sda8),并且大多数帖子解释了如何调整分区大小,但他们都没有指定扩展Linux分区后如何重建grub

第一个图像是磁盘的当前状态

第二张图片是我希望它扩展的方式(来自 Kali Linux -LIVE USB)

这是磁盘的当前状态(非实时)

这就是我想要的样子(Gparted Live)

/dev/sda8 ==>> Linux 分区

/dev/sda6 ==>> 窗口分区(E盘:)

我想扩展 /dev/sda8,因为我是从右侧/起始扇区扩展它,所以必须重新配置 Grub,对吗?扩展Linux分区后如何重建grub?

我使用的是 Debian Linux 发行版,名为Kali Linux,以下是我的笔记本电脑的主要信息,可能会有所帮助。

fdisk -l                                 
Disk /dev/sda: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA MQ04ABF1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: A60A71DD-D86F-4DB5-9A7A-915AE5991E42

Device          Start        End   Sectors   Size Type
/dev/sda1        2048     534527    532480   260M EFI System
/dev/sda2      534528     567295     32768    16M Microsoft reserved
/dev/sda3      567296  314778396 314211101 149.8G Microsoft basic data
/dev/sda4   314779648  316571647   1792000   875M Windows recovery environment
/dev/sda5   316571648 1083027455 766455808 365.5G Microsoft basic data
/dev/sda6  1134227456 1848948735 714721280 340.8G Microsoft basic data
/dev/sda7  1951885312 1953523711   1638400   800M Windows recovery environment
/dev/sda8  1848948736 1942423551  93474816  44.6G Linux filesystem
/dev/sda9  1942423552 1951885311   9461760   4.5G Linux swap

Partition table entries are not in disk order.



  df -h
    Filesystem      Size  Used Avail Use% Mounted on
    udev            1.8G     0  1.8G   0% /dev
    tmpfs           376M  2.0M  374M   1% /run
    /dev/sda8        44G   39G  3.2G  93% /
    tmpfs           1.9G  104M  1.8G   6% /dev/shm
    tmpfs           5.0M  4.0K  5.0M   1% /run/lock
    /dev/sda1       256M   26M  231M  11% /boot/efi
    tmpfs           376M   88K  376M   1% /run/user/0

mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=1880636k,nr_inodes=470159,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,size=384424k,mode=755)
/dev/sda8 on / type ext4 (rw,relatime,errors=remount-ro)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
efivarfs on /sys/firmware/efi/efivars type efivarfs (rw,nosuid,nodev,noexec,relatime)
none on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14743)
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)
sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=384420k,nr_inodes=96105,mode=700)
gvfsd-fuse on /run/user/0/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0)
tracefs on /sys/kernel/debug/tracing type tracefs (rw,nosuid,nodev,noexec,relatime


cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda8 during installation
UUID=c1b32d6c-34a5-4628-b126-862be53fc9de /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=E06C-6211  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda9 during installation
UUID=9a8a2b86-53c5-4667-8e07-9e4304a2191d none            swap    sw              0       0

相关内容