スワップはDebianで突然消えましたか?

スワップはDebianで突然消えましたか?

6ヶ月間、すべてが順調に進み、今日の私の交換は突然消えました。さて、見てみると、ディスクパーティショニングに奇妙なことがわかりました。どうしたの?すべてを再インストールせずにすばやく復元するにはどうすればよいですか? (新しくインストールする前にすべきことの1つ)

これは私のものです。/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>
/dev/mapper/ubuntu--vg-root /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda1 during installation
UUID=ede3c189-5d39-4f55-b263-0d6bcafc5d7b /boot           ext4    defaults        0       2
/dev/mapper/ubuntu--vg-swap_1 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
# /dev/sdb1       /media/usb0     auto    rw,user,noauto  0       0
# /dev/sdc1       /media/usb1     auto    rw,user,noauto  0       0 

(ところで「Ubuntu」はなぜあるのでしょうか?)

結果は次のとおりですsudo fdisk -l /dev/sda

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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 identifier: 0x000aabb9

Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   83  Linux
/dev/sda2          501758   625141759   312320001    5  Extended
/dev/sda5          501760   625141759   312320000   8e  Linux LVM

lvm情報の出力は次のとおりです。ls -l /dev/mapper

total 0
crw------T 1 root root 10, 236 juin  29 07:28 control
lrwxrwxrwx 1 root root       7 juin  29 07:28 ubuntu--vg-root -> ../dm-0
lrwxrwxrwx 1 root root       7 juin  29 07:28 ubuntu--vg-swap_1 -> ../dm-1

..出力lvscan

ACTIVE            '/dev/ubuntu-vg/root' [294,10 GiB] inherit
ACTIVE            '/dev/ubuntu-vg/swap_1' [3,74 GiB] inherit

..そして出力pvscan

PV /dev/sda5   VG ubuntu-vg   lvm2 [297,85 GiB / 12,00 MiB free]
Total: 1 [297,85 GiB] / in use: 1 [297,85 GiB] / in no VG: 0 [0   ]

..その夜、私たちが私のディスクからUbuntuを正しくクリアしていない可能性があるという事実は、日が経つにつれて明確になるようです -_-

スワップをすべて消去する前にすばやくスワップを元に戻す方法はありますか?

ベストアンサー1

デバイス切り替えを有効にするには:

swapon /dev/mapper/ubuntu--vg-swap_1

何らかの方法で破損してそのスワップ領域にエラーがある場合は、次のコマンドを使用してスワップデバイスを再フォーマットできます。

mkswap /dev/mapper/ubuntu--vg-swap_1

swapon(1)詳細については、関連するマニュアルページを確認してくださいmkswap(1)

おすすめ記事