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 shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 327B5C4332F for ; Mon, 2 Jan 2023 02:38:16 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.96) (envelope-from ) id 1pCAiD-0000F6-0i; Sun, 01 Jan 2023 21:38:05 -0500 Received: from mscreen.etri.re.kr ([129.254.9.16]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (Exim 4.96) (envelope-from ) id 1pCAi8-0008Pc-19 for kernelnewbies@kernelnewbies.org; Sun, 01 Jan 2023 21:38:01 -0500 Received: from unknown (HELO send001-relay.gov-dooray.com) (211.180.235.152) by 129.254.9.16 with ESMTP; 2 Jan 2023 11:37:50 +0900 X-Original-SENDERIP: 211.180.235.152 X-Original-MAILFROM: ckim@etri.re.kr X-Original-RCPTTO: kernelnewbies@kernelnewbies.org Received: from [10.162.225.112] (HELO smtp002-imp.gov-dooray.com) ([10.162.225.112]) by send001-relay.gov-dooray.com with SMTP id 50da5d9563b2437e; Mon, 02 Jan 2023 11:37:50 +0900 DKIM-Signature: a=rsa-sha256; b=Bo/TPpS4dhxCq7Z8ZDVhkUyrak0vORZnoTBxte12c3u1lLU45Nf+gFXO+VNlzem5xTbC7Kz1bf TqZ3Ej7QwiaVQ7R40JUoPC1x1/9g6SFhVaXoPCyHSru+x+bVC0vbmir2eZMHC571QVAk93aFZ9IX de8fbLUXX+WvbI0Tz6ytwopiSipcp5inXycf3VUaPRyZ21xIu0CAn8t3sPu8gWIAaJ+rWzZmHamG KoGh/1rTlwhV1IleImNXyvI4065fzMvrVqeP6jndim2VDxjBBhtirnIVj7yx1ZBby9wYhQXtCsSI lw2ZRs583ualxJkyXCuTkGRthMUsNzGMT31dOkSA==; c=relaxed/relaxed; s=selector; d=dooray.com; v=1; bh=iWzBMcc3XhVY9db+RVeGKrU43mWND3qp+4ADBeoEE3E=; h=From:To:Subject:Message-ID; Received: from [129.254.132.39] (HELO CHANKIMPC) ([129.254.132.39]) by smtp002-imp.gov-dooray.com with SMTP id c0ae2a3f63b2437e; Mon, 02 Jan 2023 11:37:50 +0900 From: "Chan Kim" To: "'Nicholas Mc Guire'" , "'Bernd Petrovitsch'" References: <072001d8d9f5$0fb3dbd0$2f1b9370$@etri.re.kr> <20230101192323.GA23315@osadl.at> In-Reply-To: <20230101192323.GA23315@osadl.at> Subject: RE: How is the size of init ram disk determined when initramfs is used? Date: Mon, 2 Jan 2023 11:37:49 +0900 Message-ID: <000601d91e53$34f6d210$9ee47630$@etri.re.kr> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJiRLqiIhm1hqah4wI5jym/Qs/+nQGjmdyRAnAP7QetV31eIA== Content-Language: ko Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Hello all, Thanks for the replies and discussion. So following Bernd's suggestion, I tried making a big file to see how big the file system can grow. Using qemu (arm64, I think it will be the same in real machine, it was always almost the same), I tried 'dd if=/dev/zero of=test bs=1M count=768' and I see a file with size 768MB is generated. So it seems it uses the available ram (I had 1GB ram, and the initial file system size was only 19MB) (BTW, I had to do 'mknod /dev/zero c 1 5 in the init script for this) My real board doesn't have disk connected now and we'll be doing things on ram for now. Thank you. Chan Kim >-----Original Message----- >From: Nicholas Mc Guire >Sent: Monday, January 2, 2023 4:23 AM >To: Bernd Petrovitsch >Cc: kernelnewbies@kernelnewbies.org >Subject: Re: How is the size of init ram disk determined when initramfs is >used? > >On Sun, Jan 01, 2023 at 06:32:55PM +0100, Bernd Petrovitsch wrote: >> Hi all! >> >> On 07/10/2022 04:32, Chan Kim wrote: >> [...] >> >I'm using initramfs.cpio.gz for initial file system image. >> >I embed it in the kernel Image file. >> >After linux boots, when I'm in the shell, I can create files. >> >But I'm curious how much the file system can grow. >> >> Why not just try it once;-) > >ramdisks are static - so if you mount ram0 and ramdisk_size=8192 then your >ramdisk is occupying 8MB and that will be the hard limit at least on some >architectures (x86, I think also arm). > >> >> >I remember somewhere reading that the initramdisk is made and the >> >initramfs archive is extracted in the ramdisk. > >On some architectures you can pass the size as kernel parameter >ramdisk_size=#kb and that will then set the size of the ramdisk when you >mount it (at boot or during normaal operations). > >As I did not find what archtiecture you are refering to this might help - >grep for ramdisk_size in Documentations and you should have it. E.g. for arm >it is marked as obsolete (arm/boot.rst) but still seems to be supported with >CONFIG_DEPRECATED_PARAM_STRUCT set. >Wonder what it is being replaced by. > >thx! >hofrat > >_______________________________________________ >Kernelnewbies mailing list >Kernelnewbies@kernelnewbies.org >https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies