1, 配置grub ,设定ramdisk_size= size
[root@localhost ~]# cat /etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/vda6 # initrd /initrd-[generic-]version.img #boot=/dev/vda default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.32-358.el6.x86_64) root (hd0,0) kernel /vmlinuz-2.6.32-358.el6.x86_64 ro root=UUID=5f60bd8c-5991-4101-a1f4-a08f3ef88832 rd_NO_LUKS rd_NO_LVM LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet ramdisk_size=102400 initrd /initramfs-2.6.32-358.el6.x86_64.img
2, 创建目录
mkdir /ramdisk
3, 格式化ram0 内存硬盘
mke2fs /dev/ram0
4, 开机自动挂载
经过验证,无法采用fstab 挂载
5,手动挂载
mount /dev/ram0 /ramdisk
本文出自 “欢迎评论,欢迎点赞” 博客,请务必保留此出处http://swq499809608.blog.51cto.com/797714/1617575
原文地址:http://swq499809608.blog.51cto.com/797714/1617575