AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1124668
Accepted
Amanda
Amanda
Asked: 2019-03-11 21:06:19 +0800 CST2019-03-11 21:06:19 +0800 CST 2019-03-11 21:06:19 +0800 CST

Como habilito uma partição swap que parece estar oculta?

  • 772

Ao tentar solucionar problemas de uma máquina que está ficando sem memória e travando bastante: O que eu faço sobre uma máquina que está ficando sem memória e travando?

Eu descobri que, embora haja uma partição Swap em /dev/sda8:

Disk /dev/sda: 238.5 GiB, 256060514304 bytes, 500118192 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: gpt
Disk identifier: 9A31978F-5B21-44F6-BF08-34F2D2AD62B6

Device         Start       End   Sectors  Size Type
/dev/sda1       2048   2050047   2048000 1000M Windows recovery environment
/dev/sda2    2050048   2582527    532480  260M EFI System
/dev/sda3    2582528   2844671    262144  128M Microsoft reserved
/dev/sda4    2846720 256557055 253710336  121G Linux filesystem
/dev/sda5  457578496 485437439  27858944 13.3G Windows recovery environment
/dev/sda6  485437440 500117503  14680064    7G Intel Fast Flash
/dev/sda7  256557056 441047039 184489984   88G Linux filesystem
/dev/sda8  441047040 457578495  16531456  7.9G Linux swap

Embora esteja lá, não está sendo usado.

              total        used        free      shared  buff/cache   available
Mem:           7.7G        3.9G        1.8G        1.3G        2.0G        2.2G
Swap:            0B          0B          0B

Parece que foi comentado em 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/sda7 during installation
UUID=1c458890-63a1-4c38-befa-66148cb6f8c2 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=F232-FC61  /boot/efi       vfat    defaults        0       1
# swap was on /dev/sda8 during installation
#UUID=968be4fc-0850-471c-b6f8-21ecb10626dc none            swap    sw              0       0
#/dev/mapper/cryptswap1 none swap sw 0 0
/dev/disk/by-uuid/2C883E19883DE1CE /mnt/2C883E19883DE1CE auto nosuid,nodev,nofail,x-gvfs-show 0 0
/dev/disk/by-uuid/32033d20-8c17-48f4-b014-6f581099441b /media/misc auto nosuid,nodev,nofail,x-gvfs-show 0 0

Mas nem tenho certeza se esse é o uuid correto, porque /dev/sda8não aparece em ls -lha /dev/disk/by-uuid/:

amanda@Flatbush:~$ ls -lha /dev/disk/by-uuid/
total 0
drwxr-xr-x 2 root root 140 Mar 10 19:08 .
drwxr-xr-x 8 root root 160 Mar 10 19:08 ..
lrwxrwxrwx 1 root root  10 Mar 10 19:08 1c458890-63a1-4c38-befa-66148cb6f8c2 -> ../../sda7
lrwxrwxrwx 1 root root  10 Mar 10 19:08 32033d20-8c17-48f4-b014-6f581099441b -> ../../sda4
lrwxrwxrwx 1 root root  10 Mar 10 19:08 76B631A3B63164B1 -> ../../sda1
lrwxrwxrwx 1 root root  10 Mar 10 19:08 8E9A2F109A2EF3FD -> ../../sda5
lrwxrwxrwx 1 root root  10 Mar 10 19:08 F232-FC61 -> ../../sda2

blkidmostra um UUID diferente de /etc/fstab:

amanda@Flatbush:~$ sudo blkid
/dev/sda1: LABEL="WINRE_DRV" UUID="76B631A3B63164B1" TYPE="ntfs" PARTUUID="8df271fe-b011-4817-99d6-a73603990fed"
/dev/sda2: LABEL="SYSTEM_DRV" UUID="F232-FC61" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="e022f5a1-9ef4-470b-b245-fc3f808e990a"
/dev/sda4: UUID="32033d20-8c17-48f4-b014-6f581099441b" TYPE="ext4" PARTLABEL="Media" PARTUUID="5561a792-93fe-41ca-b8ce-decf065bcae2"
/dev/sda5: LABEL="Lenovo_Recovery" UUID="8E9A2F109A2EF3FD" TYPE="ntfs" PARTUUID="120ea024-5d62-414f-86e7-20b4dc584b58"
/dev/sda7: UUID="1c458890-63a1-4c38-befa-66148cb6f8c2" TYPE="ext4" PARTUUID="f86d11cd-ae91-49af-b93e-944e3da180cc"
/dev/loop0: TYPE="squashfs"
/dev/loop1: TYPE="squashfs"
/dev/loop2: TYPE="squashfs"
/dev/loop3: TYPE="squashfs"
/dev/loop4: TYPE="squashfs"
/dev/loop5: TYPE="squashfs"
/dev/loop6: TYPE="squashfs"
/dev/loop7: TYPE="squashfs"
/dev/sda3: PARTLABEL="Microsoft reserved partition" PARTUUID="7a7bbfd5-6b38-4a5c-9c9e-dc9b9dd2a601"
/dev/sda6: PARTLABEL="Basic data partition" PARTUUID="9e10a03b-af15-4ee1-a14f-95c570100a40"
/dev/sda8: PARTUUID="401fbf68-8440-4f27-9337-9f11689a705b"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
...

e e2fsckdiz que há um "número mágico ruim":

amanda@Flatbush:~$ sudo e2fsck /dev/sda8
e2fsck 1.44.1 (24-Mar-2018)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/sda8

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

Diante de tudo isso, qual é o caminho certo ™ para obter uma partição swap nesta máquina. Executando 18.04.2.

PS. Não acho que isso importe aqui, mas quando construí originalmente a máquina, pensei que havia uma chance de ele odiar rodar o Linux, então deixei a partição de recuperação do Windows. Ele estava bem com o Linux até que começou a sufocar.

swap partitioning
  • 1 1 respostas
  • 825 Views

1 respostas

  • Voted
  1. Best Answer
    Amanda
    2019-03-12T09:05:51+08:002019-03-12T09:05:51+08:00

    Não posso prometer que fiz do jeito certo ™, mas eu...

    • instalei o gparted e
    • reformatei a partição swap e depois
    • adicionou uma nova linha com o UUID correto para /etc/fstabe
    • habilitado comsudo swapon

    Mesmo após uma reinicialização, free -hmostra 7,9 G de troca total. Então isso parece ter funcionado. Infelizmente, ainda não tenho ideia de como isso engasgou, mas acho que você não pode saber tudo.

    • 1

relate perguntas

  • Como esvaziar a troca se houver RAM livre?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve