简体   繁体   English

solaris 10(sparc64)ramdisk(如shmfs或tmpfs)

[英]solaris 10 (sparc64) ramdisk (like shmfs or tmpfs)

There is an ramdisk capability in Linux, which is achieved with mounting shmfs of tmpfs, like: Linux中有一个ramdisk功能,可以通过安装tmpfs的shmfs实现,如:

# mount -t shm shmfs -o size=20g /dev/shm

or 要么

# mount –t tmpfs tmpfs /dev/shm

Also, some linuxes have ramfs , which is "ramfs is similar to shmfs, except that pages are not pageable or swappable" 此外,一些linux有ramfs ,“ramfs类似于shmfs,除了页面不可分页或可交换”

# mount -t ramfs ramfs /dev/shm

I want to create ramdisk on solaris 10 (sparc64) with big size (tens of GB). 我想在solaris 10(sparc64)上创建大尺寸(几十GB)的ramdisk。 How can I do this in solaris? 我怎样才能在solaris中做到这一点? How can I create not just a ramdisk in solaris, but nonswappable ramdisk? 我怎样才能在solaris中创建一个ramdisk,而不是不可用的ramdisk?

Then I want to use big file from ramdisk to mmap memory into 32-bit process, so the solution should allow me to mmap small parts of files from ramdisk into 32bit application. 然后我想使用ramdisk的大文件将内存映射到32位进程,因此解决方案应该允许我将ramdisk中的小部分文件映射到32位应用程序。

For a virtual memory based disk: 对于基于虚拟内存的磁盘:

# mount -F tmpfs -o size=20000m swap /mountpoint

For a physical memory one: 对于物理内存一个:

# a=$(ramdiskadm -a bigdisk 20g)
# newfs $a
# mount $a /mountpoint

By the way, Solaris (more precisely SunOS) was the first Unix to implement tmpfs around 1987. 顺便说一句,Solaris(更准确地说是SunOS)是1987年左右第一个实现tmpfs的Unix。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM