無法在Solaris 上新增交換文件

無法在Solaris 上新增交換文件

我正在嘗試在 Solaris 10 上新增交換檔swap.file。然後,我使用以下命令新增交換文件:

swap -a /swap.file

顯示錯誤:

/swap.file:大小無效

我究竟做錯了什麼?

答案1

您可能正在運行 32 位元核心。您只需建立 2 x 1 GB 交換檔案並單獨新增它們。

# rm /swap.file
# /usr/sbin/mkfile 1024m /swap1
# /usr/sbin/mkfile 1024m /swap2
# /usr/sbin/swap -a /swap1
# /usr/sbin/swap -a /swap2

此外,為了使此設定在重新啟動後繼續存在,您還需要在 /etc/vfstab 檔案中新增行,例如:

/swap1 - - swap - no -
/swap2 - - swap - no -

相關內容