From mboxrd@z Thu Jan 1 00:00:00 1970 From: Asias He Subject: Re: [PATCH v2 2/2] kvm tools: Add '--rootfs' and '--binsh' Date: Thu, 04 Aug 2011 00:18:55 +0800 Message-ID: <4E3974EF.10308@gmail.com> References: <1312310789-22817-1-git-send-email-levinsasha928@gmail.com> <1312310789-22817-2-git-send-email-levinsasha928@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: penberg@kernel.org, kvm@vger.kernel.org, aneesh.kumar@linux.vnet.ibm.com, mingo@elte.hu, gorcunov@gmail.com To: Sasha Levin Return-path: Received: from mail-pz0-f42.google.com ([209.85.210.42]:62665 "EHLO mail-pz0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753709Ab1HCQTM (ORCPT ); Wed, 3 Aug 2011 12:19:12 -0400 Received: by pzk37 with SMTP id 37so295391pzk.1 for ; Wed, 03 Aug 2011 09:19:12 -0700 (PDT) In-Reply-To: <1312310789-22817-2-git-send-email-levinsasha928@gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/03/2011 02:46 AM, Sasha Levin wrote: > This patch adds 2 new flags: > > --rootfs [path] - Specifies a path to use as rootfs. The path will be mounted > using virtio-9p and booted from. > Easiest way to test it is to mount the sample image we recommend with kvm tool > (http://wiki.qemu.org/download/linux-0.2.img.bz2) and mounting it somewhere. > *PLEASE DO NOT TRY BOOTING FROM YOUR REAL ROOT AKA '/', EVEN WITH READ ONLY > SET* - Lets make sure the code is bulletproof before we delete your rootfs :) > > --binsh - This flag will boot into simple /bin/sh shell instead of going > through /sbin/init. This is usefull for more complex distribution rootfs > where we have to deal with /etc/fstab and such. > > Signed-off-by: Sasha Levin This is damn impressive! All I needed is: ./kvm run -k /home/asias/qemu-stuff/bzImage --rootfs /mnt/ I found that if I boot with ./kvm run -k /home/asias/qemu-stuff/bzImage --rootfs /mnt/ I will get: sh-2.05b# echo a > /root/a sh: /root/a: No such file or directory If I boot with sudo ./kvm run -k /home/asias/qemu-stuff/bzImage --rootfs /mnt/ sh-2.05b# echo a > /root/a works. It seems that it is a permission related problem, however, the warning message is "/root/a: No such file or directory", any ideas? -- Best Regards, Asias He