How to automatically mount swap partition?

I didn't использовал в swap partition during installation so now that my ubuntu is installed, I used Печатающий Гпартед Партитион to верьте an unallocated partition which в I formatted эксперт linux-swap. It didn't automatically mount so I right clicked it and selected swapon. Now, whenever I boot the laptop, the partition is not mounted automatically. Swapon still works but if the partition isn't mounted at boot, its эксперт good эксперт useless. I saw some answers which said to edit some file named Fstab, but гm not sure about what changes to make... Please help я by giving step-by-step instructions эксперт Им в ОБЩЕЕ КОЛИЧЕСТВО noob and don't know U of Ubuntu, гm having в lot of problems... please help я! :'( :( HerВs what my fstab file contains -

# /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/sda2 during installation
UUID=33a0fc77-06b0-406c-95fd-15bf7033b619 /               ext4    errors=remount-ro 0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
11
задан 19 December 2015 в 04:11

2 ответа

Это - Ваше предыдущее /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/sda2 during installation
UUID=33a0fc77-06b0-406c-95fd-15bf7033b619 /               ext4    errors=remount-ro 0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

Теперь, для добавления раздела подкачки к нему, делают следующее:

  1. Открытый Gparted.

    Gparted screenshot

  2. Щелкают правой кнопкой по разделу подкачки и нажимают Information.

    select partition in Gparted

  3. Записывают Ваш UUID.

    UUID in partition info

  4. Теперь, измените свое предыдущее /etc/fstab путем выполнения следующего:

    • Открывают файл путем ввода команды:

      sudo -H gedit /etc/fstab
      
    • Затем добавьте эту строку,

      UUID=THE UUID YOU OBTAINED FROM ABOVE none       swap   sw         0     0
      

      после того, как строка

      # a swapfile is not a swap partition, no line here
      
    • Сохранит файл и перезапустит Ваш компьютер. Все должно работать теперь.

17
ответ дан 23 November 2019 в 03:58

Введите в терминале:

gnome-disks 

Затем выберите раздел подкачки. В меню настроек выберите опцию «Редактировать крепление» .

1
ответ дан 23 November 2019 в 03:58

Другие вопросы по тегам:

Похожие вопросы: