Zsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget0/translations/zh_CN/admin-guide/blockdev/ramdiskmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/zh_TW/admin-guide/blockdev/ramdiskmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/it_IT/admin-guide/blockdev/ramdiskmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ja_JP/admin-guide/blockdev/ramdiskmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/ko_KR/admin-guide/blockdev/ramdiskmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget0/translations/sp_SP/admin-guide/blockdev/ramdiskmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhsection)}(hhh](htitle)}(h*Using the RAM disk block device with Linuxh]h*Using the RAM disk block device with Linux}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhJ/var/lib/git/docbuild/linux/Documentation/admin-guide/blockdev/ramdisk.rsthKubhcomment)}(hxContents: 1) Overview 2) Kernel Command Line Parameters 3) Using "rdev" 4) An Example of Creating a Compressed RAM Diskh]hxContents: 1) Overview 2) Kernel Command Line Parameters 3) Using "rdev" 4) An Example of Creating a Compressed RAM Disk}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhhhK ubh)}(hhh](h)}(h 1) Overviewh]h 1) Overview}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXYThe RAM disk driver is a way to use main system memory as a block device. It is required for initrd, an initial filesystem used if you need to load modules in order to access the root filesystem (see Documentation/admin-guide/initrd.rst). It can also be used for a temporary filesystem for crypto work, since the contents are erased on reboot.h]hXYThe RAM disk driver is a way to use main system memory as a block device. It is required for initrd, an initial filesystem used if you need to load modules in order to access the root filesystem (see Documentation/admin-guide/initrd.rst). It can also be used for a temporary filesystem for crypto work, since the contents are erased on reboot.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe RAM disk dynamically grows as more space is required. It does this by using RAM from the buffer cache. The driver marks the buffers it is using as dirty so that the VM subsystem does not try to reclaim them later.h]hThe RAM disk dynamically grows as more space is required. It does this by using RAM from the buffer cache. The driver marks the buffers it is using as dirty so that the VM subsystem does not try to reclaim them later.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe RAM disk supports up to 16 RAM disks by default, and can be reconfigured to support an unlimited number of RAM disks (at your own risk). Just change the configuration symbol BLK_DEV_RAM_COUNT in the Block drivers config menu and (re)build the kernel.h]hThe RAM disk supports up to 16 RAM disks by default, and can be reconfigured to support an unlimited number of RAM disks (at your own risk). Just change the configuration symbol BLK_DEV_RAM_COUNT in the Block drivers config menu and (re)build the kernel.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hTo use RAM disk support with your system, run './MAKEDEV ram' from the /dev directory. RAM disks are all major number 1, and start with minor number 0 for /dev/ram0, etc. If used, modern kernels use /dev/ram0 for an initrd.h]hTo use RAM disk support with your system, run ‘./MAKEDEV ram’ from the /dev directory. RAM disks are all major number 1, and start with minor number 0 for /dev/ram0, etc. If used, modern kernels use /dev/ram0 for an initrd.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe new RAM disk also has the ability to load compressed RAM disk images, allowing one to squeeze more programs onto an average installation or rescue floppy disk.h]hThe new RAM disk also has the ability to load compressed RAM disk images, allowing one to squeeze more programs onto an average installation or rescue floppy disk.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK#hhhhubeh}(h]overviewah ]h"] 1) overviewah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(h 2) Parametersh]h 2) Parameters}(hj-hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj*hhhhhK)ubh)}(h"2a) Kernel Command Line Parametersh]h"2a) Kernel Command Line Parameters}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hj*hhubh block_quote)}(h,ramdisk_size=N Size of the ramdisk. h]hdefinition_list)}(hhh]hdefinition_list_item)}(h$ramdisk_size=N Size of the ramdisk. h](hterm)}(hramdisk_size=Nh]hramdisk_size=N}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1jZhhhK.hjVubh definition)}(hhh]h)}(hSize of the ramdisk.h]hSize of the ramdisk.}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hjlubah}(h]h ]h"]h$]h&]uh1jjhjVubeh}(h]h ]h"]h$]h&]uh1jThhhK.hjQubah}(h]h ]h"]h$]h&]uh1jOhjKubah}(h]h ]h"]h$]h&]uh1jIhhhK-hj*hhubh)}(hfThis parameter tells the RAM disk driver to set up RAM disks of N k size. The default is 4096 (4 MB).h]hfThis parameter tells the RAM disk driver to set up RAM disks of N k size. The default is 4096 (4 MB).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hj*hhubh)}(h2b) Module parametersh]h2b) Module parameters}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hj*hhubjJ)}(hxrd_nr /dev/ramX devices created. max_part Maximum partition number. rd_size See ramdisk_size. h]jP)}(hhh](jU)}(h!rd_nr /dev/ramX devices created. h](j[)}(hrd_nrh]hrd_nr}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jZhhhK6hjubjk)}(hhh]h)}(h/dev/ramX devices created.h]h/dev/ramX devices created.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jjhjubeh}(h]h ]h"]h$]h&]uh1jThhhK6hjubjU)}(h#max_part Maximum partition number. h](j[)}(hmax_parth]hmax_part}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jZhhhK9hjubjk)}(hhh]h)}(hMaximum partition number.h]hMaximum partition number.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjubah}(h]h ]h"]h$]h&]uh1jjhjubeh}(h]h ]h"]h$]h&]uh1jThhhK9hjubjU)}(hrd_size See ramdisk_size. h](j[)}(hrd_sizeh]hrd_size}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jZhhhK /tmp/ram_image.gz h](h)}(hCompress the contents of the RAM disk. The level of compression will be approximately 50% of the space used by the files. Unused space on the RAM disk will compress to almost nothing::h]hCompress the contents of the RAM disk. The level of compression will be approximately 50% of the space used by the files. Unused space on the RAM disk will compress to almost nothing:}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKohjnubj)}(h?dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gzh]h?dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gz}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKshjnubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hFPut the kernel onto the floppy:: dd if=zImage of=/dev/fd0 bs=1k h](h)}(h Put the kernel onto the floppy::h]hPut the kernel onto the floppy:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKuhjubj)}(hdd if=zImage of=/dev/fd0 bs=1kh]hdd if=zImage of=/dev/fd0 bs=1k}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKwhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hXPut the RAM disk image onto the floppy, after the kernel. Use an offset that is slightly larger than the kernel, so that you can put another (possibly larger) kernel onto the same floppy later without overlapping the RAM disk image. An offset of 400 kB for kernels about 350 kB in size would be reasonable. Make sure offset+size of ram_image.gz is not larger than the total space on your floppy (usually 1440 kB):: dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400 h](h)}(hXPut the RAM disk image onto the floppy, after the kernel. Use an offset that is slightly larger than the kernel, so that you can put another (possibly larger) kernel onto the same floppy later without overlapping the RAM disk image. An offset of 400 kB for kernels about 350 kB in size would be reasonable. Make sure offset+size of ram_image.gz is not larger than the total space on your floppy (usually 1440 kB)::h]hXPut the RAM disk image onto the floppy, after the kernel. Use an offset that is slightly larger than the kernel, so that you can put another (possibly larger) kernel onto the same floppy later without overlapping the RAM disk image. An offset of 400 kB for kernels about 350 kB in size would be reasonable. Make sure offset+size of ram_image.gz is not larger than the total space on your floppy (usually 1440 kB):}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKyhjubj)}(h2dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400h]h2dd if=/tmp/ram_image.gz of=/dev/fd0 bs=1k seek=400}hjsbah}(h]h ]h"]h$]h&]hhuh1jhhhKhjubeh}(h]h ]h"]h$]h&]uh1jhjhhhhhNubj )}(hMake sure that you have already specified the boot information in FDARGS and FDINITRD or that you use a bootloader to pass kernel command line boot options to the kernel. h]h)}(hMake sure that you have already specified the boot information in FDARGS and FDINITRD or that you use a bootloader to pass kernel command line boot options to the kernel.h]hMake sure that you have already specified the boot information in FDARGS and FDINITRD or that you use a bootloader to pass kernel command line boot options to the kernel.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jhjhhhhhNubeh}(h]h ]h"]h$]h&]enumtype loweralphaprefixhsuffix)uh1jhjhhhhhK`ubh)}(hThat is it. You now have your boot/root compressed RAM disk floppy. Some users may wish to combine steps (d) and (f) by using a pipe.h]hThat is it. You now have your boot/root compressed RAM disk floppy. Some users may wish to combine steps (d) and (f) by using a pipe.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubjJ)}(hPaul Gortmaker 12/95 h]h)}(hPaul Gortmaker 12/95h]hPaul Gortmaker 12/95}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jIhhhKhjhhubeh}(h],an-example-of-creating-a-compressed-ram-diskah ]h"]/4) an example of creating a compressed ram diskah$]h&]uh1hhhhhhhhKUubh)}(hhh](h)}(h Changelog:h]h Changelog:}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj1hhhhhKubh)}(h SEPT-2020 :h]h SEPT-2020 :}(hjBhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhj1hhubjJ)}(hRemoved usage of "rdev" h]h)}(hRemoved usage of "rdev"h]hRemoved usage of “rdev”}(hjThhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjPubah}(h]h ]h"]h$]h&]uh1jIhhhKhj1hhubjP)}(hhh](jU)}(h10-22-04 : Updated to reflect changes in command line options, remove obsolete references, general cleanup. James Nelson (james4765@gmail.com) h](j[)}(h 10-22-04 :h]h 10-22-04 :}(hjohhhNhNubah}(h]h ]h"]h$]h&]uh1jZhhhKhjkubjk)}(hhh]h)}(hUpdated to reflect changes in command line options, remove obsolete references, general cleanup. James Nelson (james4765@gmail.com)h](hoUpdated to reflect changes in command line options, remove obsolete references, general cleanup. James Nelson (}(hjhhhNhNubh reference)}(hjames4765@gmail.comh]hjames4765@gmail.com}(hjhhhNhNubah}(h]h ]h"]h$]h&]refurimailto:james4765@gmail.comuh1jhjubh)}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhj}ubah}(h]h ]h"]h$]h&]uh1jjhjkubeh}(h]h ]h"]h$]h&]uh1jThhhKhjhubjU)}(h12-95 : Original Documenth](j[)}(h12-95 :h]h12-95 :}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jZhhhKhjubjk)}(hhh]h)}(hOriginal Documenth]hOriginal Document}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jjhjubeh}(h]h ]h"]h$]h&]uh1jThhhKhjhhhubeh}(h]h ]h"]h$]h&]uh1jOhj1hhhhhNubeh}(h] changelogah ]h"] changelog:ah$]h&]uh1hhhhhhhhKubeh}(h]*using-the-ram-disk-block-device-with-linuxah ]h"]*using the ram disk block device with linuxah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksentryfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjj'j$jVjSjjj.j+jju nametypes}(jj'jVjj.juh}(jhj$hjSj*jjYj+jjj1u footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.