当前位置: 技术问答>linux和unix
很菜的问题,请指教!
来源: 互联网 发布时间:2014-12-06
本文导语: 安装linux的话,是不是一定要分出一小块(100m左右)的硬盘分区来作为数据交换分区,如果是这样的话,我如果要装不同的linux的话,是不是应该分出相应多的硬盘分区来作为数据交换分区?能不能安装的时候将数据...
安装linux的话,是不是一定要分出一小块(100m左右)的硬盘分区来作为数据交换分区,如果是这样的话,我如果要装不同的linux的话,是不是应该分出相应多的硬盘分区来作为数据交换分区?能不能安装的时候将数据交换分区装在安装硬盘上而不采用新的硬盘分区?
|
Hi Wang,
1. You can share the same swap partition between different Linux versions (if any).
2. You may also use swap file to use for swap. A swap file should be with no hole. To generate a swapfile(100M), you can follow the steps below.
dd if=/dev/zero of=/mnt/swapfile bs=1k count=10000000
mkswap /mnt/swapfile
swapon /mnt/swapfile
You may also want to add the last line "swapon /mnt/swapfile" to /etc/rc.d/rc.local, thus each time linux boots up, this swapfile will be activated automatically. Please be carefile on doing this step.
For detailed descriptions on the command and config file, you can use command "man", such as "man swapon", "man fstab", "man mkswap",
"man dd", etc.
Enjoy!
Orsino
1. You can share the same swap partition between different Linux versions (if any).
2. You may also use swap file to use for swap. A swap file should be with no hole. To generate a swapfile(100M), you can follow the steps below.
dd if=/dev/zero of=/mnt/swapfile bs=1k count=10000000
mkswap /mnt/swapfile
swapon /mnt/swapfile
You may also want to add the last line "swapon /mnt/swapfile" to /etc/rc.d/rc.local, thus each time linux boots up, this swapfile will be activated automatically. Please be carefile on doing this step.
For detailed descriptions on the command and config file, you can use command "man", such as "man swapon", "man fstab", "man mkswap",
"man dd", etc.
Enjoy!
Orsino