swap file在btrfs分区Invalid argument问题

简介: 我试图在openSUSE 42.2系统的根分区创建一个swap文件,却无法正常挂载。 经过查询应该是btrfs系统这种类型的文件系统不支持swap文件。 另外还有一个btrfs-swapon的项目可以在btrfs上挂载swap文件,但文档里说不太适合在copy-on-write文件系统中创建swap,除非不得已,不建议使用。
我试图在openSUSE 42.2系统的根分区创建一个swap文件,却无法正常挂载。
经过查询应该是btrfs系统这种类型的文件系统不支持swap文件。
另外还有一个btrfs-swapon的项目可以在btrfs上挂载swap文件,但文档里说不太适合在copy-on-write文件系统中创建swap,除非不得已,不建议使用。Keep in mind, that a copy-on-write file system is not the best choice to use a swap file。

talen@opensuse:/> sudo dd if=/dev/zero of=/swapfile bs=1M count=8192
8192+0 records in
8192+0 records out
8589934592 bytes (8.6 GB, 8.0 GiB) copied, 15.2733 s, 562 MB/s

talen@opensuse:/> sudo mkswap /swapfile
mkswap: /swapfile: insecure permissions 0644, 0600 suggested.
Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
no label, UUID=58762fa9-d15f-4790-ad12-bbafa2f93de0

talen@opensuse:/> sudo swapon /swapfile
swapon: /swapfile: insecure permissions 0644, 0600 suggested.
swapon: /swapfile: swapon failed: Invalid argument
talen@opensuse:/> sudo chmod 0600 /swapfile
talen@opensuse:/> sudo swapon /swapfile
swapon: /swapfile: swapon failed: Invalid argument

参考:
https://github.com/sebastian-philipp/btrfs-swapon
https://superuser.com/questions/539287/swapon-failed-invalid-argument-on-a-linux-system-with-btrfs-filesystem
目录
相关文章
|
数据安全/隐私保护
Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
下面为解决问题中报的错误: Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c. Caller xfs_free_extent
421 0
Internal error XFS_WANT_CORRUPTED_GOTO at line 1635 of file fs/xfs/libxfs/xfs_alloc.c.
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
/******************************************************************************** * FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. * 说明: * 系统更新的时候遇到这个错误,记录一下处理步骤,其原因是我自己把其umount了 * 导致的问题。
6380 0