From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 87353CAC582 for ; Sat, 13 Sep 2025 00:56:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6ZcW+WL+x/vXyECMI+z650keLmdza5K4EFlWnY3DWnU=; b=ujbTALtt80dh/Y y54t6II7zFusp1ryNAvniYYGZTAIAhjwn2ovWGezZo9ebfzazGMSizNAG9Cc6uzxU38vnbzhAxxk5 1yjJoPsd5/PDtIFg12UoPj13ZGl0n+S3nx4XQVa33OR8D0izjmanY0udclbN29fwbsLqW7H+lOben ohbsak84gHwh4qOCo+1N+Mt7ueDjP30DW6dREVhC/d3gohNw/8GsG7n0AWtMstlUneQTUXOEBTLmR ubCSCQfRxouQhBXFhvB2tXIxRN7nT6iu/64copvpCq6OUlJDSvT9Oy3GCQd1Y93SQNswkVQ2hk5+n NEV+h4OwzGUovTK92xeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uxEZ4-0000000CSFg-02jU; Sat, 13 Sep 2025 00:56:30 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uxEZ2-0000000CSE8-21Iu for linux-riscv@bombadil.infradead.org; Sat, 13 Sep 2025 00:56:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=57Y6Vt+tKEG1ezrQxMY6sE7xxEuIy1GPZf6G9mOPdfs=; b=R2hMoUmjih+0LvkoDMj0Wd7vQg oLSu3A/8PjYrn80D8DwFDCbZjcZsUPFhnyJj7rvh/1+KPl9p3INZs+Mor3sJmUlCLhtl/PNIdy+ah WNR1UBrlqhgwTK75F2Id5PswweCHZaote2M5w+xRS/L3TRtiCrotSwSckABd/dUNZJMe2FAvqDVpe 8b0qbiMzMmiBzt1hi8yTaDSGvkmN3klNMfykv4LSmgZVJ2UK0604qISnFJfofy+daPVLbGXgHGp/Z LZWK8Z/nQsTBZEhpriPW01sh7JWssg3xc7xxUad8JgI5Cdboim9eI4cJyZ6FbsrlL+Yr5sNNDomoQ jLtRcBXQ==; Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]) by desiato.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uxEYz-00000006VBy-1seH for linux-riscv@lists.infradead.org; Sat, 13 Sep 2025 00:56:27 +0000 Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-62ed3e929d1so3238754a12.3 for ; Fri, 12 Sep 2025 17:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757724984; x=1758329784; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=57Y6Vt+tKEG1ezrQxMY6sE7xxEuIy1GPZf6G9mOPdfs=; b=OnDwCGjgEJnoRw8Y3WUzzzEvtL+6KKIb88IZ8cLftAu1wDB+y0vS3fVyPlk1JWwOQ5 QHhToXkoNNfoPsNk0415M7sQbSupn4s7hbT11k3MTVuXJHCNvVW1TImf41ApttkNGGjk udqU2oG3oaVuyJXp26jSdR5Jjwe7zZYEm0V9uljTDNm5in+H6iTl9ZbXnEbbjk03zl8P 3qpQ3ad219U5b5dGPGahm4HLOODx95Oig//JSCb9X7L4NVPMvv+iKKWdSyX2Sfwi95iv 96jW4hsmh+S6IBQxIDh/OLHQFgsagGxdYq6XQxZE1nmkZvmXyuQKpaRgrdzp8jdOGZOU Qb5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757724984; x=1758329784; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=57Y6Vt+tKEG1ezrQxMY6sE7xxEuIy1GPZf6G9mOPdfs=; b=ci6gmrWbLSuDBAa8GGBpFmAH5N90nxs84swI7+bchjA4JiIop9OBe40ldxmOKccBpQ RGwKWv1SJ3GqokguUHesel867LAoTmchZGajQb6ikPbkFeNv7hZ9YPfJEpAMKjVN1C7D 64X//syC/JIEw5ij4/rbvaWRkBWSaLgzmT5gPfa4pq3lLIT15JRDFMRlQSelGuEW8VKp TIrULO4tJ8lTEnOxYKc7GHbX5/2TDQeC0m3ugpKdQ4FkhIhaaqaHDggcx1BJvzmIt3mP /WIoHDSmDgJiA5KIlukvv+MNflAfrtLZiw1yLPb/FFOtqMsaIbUndq6BJMVqCcI7ZSI5 3sjQ== X-Forwarded-Encrypted: i=1; AJvYcCWc8y1H6KSV3QZdIogaL6ZICxTmdUpHWDIuuAYGyE/loUNfFfgGu1SROFnhso8AJwy1Yl5FukYsiZXA5Q==@lists.infradead.org X-Gm-Message-State: AOJu0YxXSyb9+BeC+M042qSbX3MWyIG6X2FQCMLnGIfJu0V7N0UT5nkZ HO27XXXtkgboI9VdieZpJbSCZvZxGHZ/6N9omr6HqMP8s77/zq+iMp7w X-Gm-Gg: ASbGncuvJ7XgtzJyifYwJyMPxxkatQwh3kf4KFhYEmFcosCJb2bsFJfBEACidvc6LYw 32PBT3HGXjSQUW6F/Y2GY7oFKljqKQC48UXVM9ELtn86xk0LNTMLeBMfpubeYI/2zMAMG8eXuL6 KaUpbFlVsRR/uBRsmjoSQTy1lNT7yIUG+Cd3N02Ktc84Eyg7v9WxK8Jv4b5XhddibrIjYCmSS19 +NvcFgTmNFdI1PUalcBdAF0Fqo3Eu5l33l783WPriW/iA4tm2ANME+Fqhxsp0VV+01vIXRKhZAc +4HedFzVCZhhp2DgTVHFL3yTi3TXl6TZW5OwAEoLTHjEMZhqKb54gzwNBYt+QTxT5Fd+O4amN/D X789/Ep/Tm5dHQlh2fBEwAmt6FIEN5g== X-Google-Smtp-Source: AGHT+IG1YYL4kFwbVvTnXfTe3odNA00ZLAAz2mLJaF8vV1UmquQWKJyitdN/Fum9NwuVLBLjujgrow== X-Received: by 2002:a17:907:3fa1:b0:b07:88aa:255b with SMTP id a640c23a62f3a-b07c354ed12mr458973666b.11.1757724983824; Fri, 12 Sep 2025 17:56:23 -0700 (PDT) Received: from localhost ([212.73.77.104]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-b07b33478besm484760966b.99.2025.09.12.17.56.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Sep 2025 17:56:23 -0700 (PDT) From: Askar Safin To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , Christian Brauner , Al Viro , Jan Kara , Christoph Hellwig , Jens Axboe , Andy Shevchenko , Aleksa Sarai , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Julian Stecklina , Gao Xiang , Art Nikpal , Andrew Morton , Eric Curtin , Alexander Graf , Rob Landley , Lennart Poettering , linux-arch@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, Ingo Molnar , linux-block@vger.kernel.org, initramfs@vger.kernel.org, linux-api@vger.kernel.org, linux-doc@vger.kernel.org, linux-efi@vger.kernel.org, linux-ext4@vger.kernel.org, "Theodore Y . Ts'o" , linux-acpi@vger.kernel.org, Michal Simek , devicetree@vger.kernel.org, Luis Chamberlain , Kees Cook , Thorsten Blum , Heiko Carstens , patches@lists.linux.dev Subject: [PATCH RESEND 15/62] doc: modernize Documentation/admin-guide/blockdev/ramdisk.rst Date: Sat, 13 Sep 2025 00:37:54 +0000 Message-ID: <20250913003842.41944-16-safinaskar@gmail.com> X-Mailer: git-send-email 2.47.2 In-Reply-To: <20250913003842.41944-1-safinaskar@gmail.com> References: <20250913003842.41944-1-safinaskar@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250913_015625_724705_81DA050A X-CRM114-Status: GOOD ( 29.28 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Update it to reflect initrd removal Signed-off-by: Askar Safin --- .../admin-guide/blockdev/ramdisk.rst | 103 ++---------------- 1 file changed, 7 insertions(+), 96 deletions(-) diff --git a/Documentation/admin-guide/blockdev/ramdisk.rst b/Documentation/admin-guide/blockdev/ramdisk.rst index e57c61108dbc..6289e085f18f 100644 --- a/Documentation/admin-guide/blockdev/ramdisk.rst +++ b/Documentation/admin-guide/blockdev/ramdisk.rst @@ -5,18 +5,14 @@ Using the RAM disk block device with Linux .. Contents: 1) Overview - 2) Kernel Command Line Parameters - 3) Using "rdev" - 4) An Example of Creating a Compressed RAM Disk + 2) Module parameters 1) Overview ----------- -The 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 +The RAM disk driver is a way to use main system memory as a block device. +It can also be used for a temporary filesystem for crypto work, since the contents are erased on reboot. The RAM disk dynamically grows as more space is required. It does this by using @@ -30,109 +26,24 @@ and (re)build the kernel. To 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. - -The 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. +for /dev/ram0, etc. -2) Parameters ---------------------------------- +2) Module parameters +-------------------- -2a) Kernel Command Line Parameters - - ramdisk_size=N + rd_size=N Size of the ramdisk. This parameter tells the RAM disk driver to set up RAM disks of N k size. The default is 4096 (4 MB). -2b) Module parameters - rd_nr /dev/ramX devices created. max_part Maximum partition number. - rd_size - See ramdisk_size. - -3) Using "rdev" ---------------- - -"rdev" is an obsolete, deprecated, antiquated utility that could be used -to set the boot device in a Linux kernel image. - -Instead of using rdev, just place the boot device information on the -kernel command line and pass it to the kernel from the bootloader. - -You can also pass arguments to the kernel by setting FDARGS in -arch/x86/boot/Makefile and specify in initrd image by setting FDINITRD in -arch/x86/boot/Makefile. - -Some of the kernel command line boot options that may apply here are:: - - ramdisk_size=M - -If you make a boot disk that has LILO, then for the above, you would use:: - - append = "ramdisk_size=M" - -4) An Example of Creating a Compressed RAM Disk ------------------------------------------------ - -To create a RAM disk image, you will need a spare block device to -construct it on. This can be the RAM disk device itself, or an -unused disk partition (such as an unmounted swap partition). For this -example, we will use the RAM disk device, "/dev/ram0". - -Note: This technique should not be done on a machine with less than 8 MB -of RAM. If using a spare disk partition instead of /dev/ram0, then this -restriction does not apply. - -a) Decide on the RAM disk size that you want. Say 2 MB for this example. - Create it by writing to the RAM disk device. (This step is not currently - required, but may be in the future.) It is wise to zero out the - area (esp. for disks) so that maximal compression is achieved for - the unused blocks of the image that you are about to create:: - - dd if=/dev/zero of=/dev/ram0 bs=1k count=2048 - -b) Make a filesystem on it. Say ext2fs for this example:: - - mke2fs -vm0 /dev/ram0 2048 - -c) Mount it, copy the files you want to it (eg: /etc/* /dev/* ...) - and unmount it again. - -d) Compress 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:: - - dd if=/dev/ram0 bs=1k count=2048 | gzip -v9 > /tmp/ram_image.gz - -e) Put the kernel onto the floppy:: - - dd if=zImage of=/dev/fd0 bs=1k - -f) Put 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 - -g) Make 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. - -That 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. - Paul Gortmaker 12/95 -- 2.47.2 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv