1, 配置grub ,设定ramdisk_size= size
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
[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, 创建目录
1
|
mkdir /ramdisk
|
3, 格式化ram0 内存硬盘
1
|
mke2fs /dev/ram0
|
4, 开机自动挂载
1
|
经过验证,无法采用fstab 挂载 |
5,手动挂载
本文转自 swq499809608 51CTO博客,原文链接:http://blog.51cto.com/swq499809608/1617575
1
|
mount /dev/ram0 /ramdisk
|