您尚未登录。

#1 2017-08-14 21:29:53

wgjak47
会员
注册时间: 2012-11-28
帖子: 17

gentoo fstab如何挂在非\分区的swapfile?

fstab内容如下:

# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't 
# needed); notail increases performance of ReiserFS (at the expense of storage 
# efficiency).  It's safe to drop the noatime options if you want and to 
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# See the manpage fstab(5) for more information.
#

# <fs>                  <mountpoint>    <type>          <opts>          <dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sdb2               /boot           ext4            defaults                0 0
/dev/sdb1               /               btrfs           defaults                0 0
/dev/sda1               /home           ext4            defaults                0 2
/dev/sda2               /var            ext4            noatime,defaults        0 2
/dev/sda3               /opt            ext4            noatime,defaults        0 2
/opt/swapfile          none            swap            sw                      0 0
/dev/cdrom              /mnt/cdrom      auto            noauto,ro               0 0
/dev/fd0                /mnt/floppy     auto            noauto                  0 0

由于\分区是btrfs的,所以无法使用swapfile,所以swapfile放在了opt,这个swapfile可以正常swapon...但是无法开机自动挂载。
已尝试过的方案:
1. 使用uuid
2. 改为/opt/.swapfile
3. sw改为defaults
都没有效果。

求大佬指点迷津QAQ

最近编辑记录 wgjak47 (2017-08-14 21:30:30)

离线

页脚