阻止 Ubuntu 使用原始交換分割區

阻止 Ubuntu 使用原始交換分割區

當我安裝 Ubuntu 16.04 時,我將其放在 250 GB SSD 上並建立了 4 GB 交換分割區。最近我一直在做一些機器學習,我一直用完我所有的 16 GB 記憶體。我決定添加一個我現有的 120 GB SSD,並將其用作專用交換驅動器。我在 /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/sda3 during installation
UUID=85206e1d-5f22-431d-8d17-bdc001895a8c /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda1 during installation
UUID=E478-855C  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda2 during installation
#UUID=ea40886f-8938-4629-b03d-ef30d5ff28c2 none            swap    sw              0       0
UUID=c23607a3-093e-4e2a-a34a-4ba10b6b603d none            swap    sw              0       0

正如您所看到的,我註解掉了第一個交換驅動器並添加了第二個交換驅動器,即我的 120 GB SSD。我遇到的問題是 Ubuntu 現在將兩個磁碟機安裝為交換分割區。我不希望它使用開機磁碟機上的原始 4GB 分割區。我可以使用磁碟管理器手動關閉啟動磁碟機的交換,但我想要一個在啟動時自動發生的解決方案。

答案1

嘗試使用 gparted。

sudo apt-get install gparted

右鍵單擊您的交換分割區並選擇swapoff

相關內容