Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Nov 2016 16:09:09 +0000
From:      Gary Palmer <gpalmer@freebsd.org>
To:        tech-lists <tech-lists@zyxst.net>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: mounting an ubuntu 14.04 bhyve image as a filesystem for editing
Message-ID:  <20161111160909.GA67078@in-addr.com>
In-Reply-To: <fa59613d-b537-2725-27aa-5d385466d83d@zyxst.net>
References:  <ad82ab98-b762-ab36-5da3-51cf366c69d1@zyxst.net> <20161110152612.GH68652@e-new.0x20.net> <fa59613d-b537-2725-27aa-5d385466d83d@zyxst.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 11, 2016 at 03:30:59PM +0000, tech-lists wrote:
> On 10/11/2016 15:26, Lars Engels wrote:
> > On Thu, Nov 10, 2016 at 12:32:07PM +0000, tech-lists wrote:
> >> Hello list,
> >>
> >> [originally sent to virtualization@ but got no replies, probably
> >> because, thinking about it, the fact that it's a bhyve image is incidental]
> >>
> >> [snipped stuff about bhyve]
> >>
> >> Is there a way of taking an ubuntu VM image that normally runs as a
> >> bhyve guest, mounting it on some mountpoint on the freebsd host and
> >> directly editing the files within it?
> >>
> >> Alternatively, is there a way of making grub boot the image into
> >> single-user-mode like one can with freebsd?
> >>
> >
> > That should work (provided sysutils/fusefs-ext4fuse is installed):
> >
> > # mdconfig -t vnode -f $ubuntu_img
> > # ext4fuse /dev/md0 /mnt
> >
> 
> Hi, thanks for looking at this.
> 
> Unfortunately it didn't work:
> 
> root@host0:/vms/138# mdconfig -t vnode -f ubuntu138.img
> md2
> 
> root@host0:/vms/138# ext4fuse /dev/md2 /mnt
> Partition doesn't contain EXT4 filesystem
> 
> root@host0:/vms/138# ls -la /dev/md2*
> crw-r-----  1 root  operator  0xb0 Nov 11 14:58 /dev/md2
> crw-r-----  1 root  operator  0xb4 Nov 11 15:06 /dev/md2s1
> crw-r-----  1 root  operator  0xb5 Nov 11 15:06 /dev/md2s2
> crw-r-----  1 root  operator  0xb6 Nov 11 15:06 /dev/md2s5
> 
> root@host0:/vms/138# ext4fuse /dev/md2s1 /mnt
> fuse: failed to open fuse device: No such file or directory


That is a different error than the others.  I somewhat suspect
that there is an ext partition on md2s1 but something else
prevented the mount from proceeding.  Is there anything in
dmesg or /var/log/messages?

Do you have a /dev/fuse?


> root@host0:/vms/138# ext4fuse /dev/md2s2 /mnt
> Partition doesn't contain EXT4 filesystem
> 
> root@host0:/vms/138# ext4fuse /dev/md2s5 /mnt
> Partition doesn't contain EXT4 filesystem
> 
> I'm certain the defaults for 14.04 are ext4. Mind you, I upgraded this 
> from ubuntu13.10. So it might be ext3.
> 
> I have ext2fs kernel module installed:
> 
> root@host0:/vms/138# kldstat | grep ext
> 13    1 0xffffffff81d90000 13c8e    ext2fs.ko
> root@host0:/vms/138#
> 
> root@host0:/vms/138# mount -t ext2fs  /dev/md2 /mnt
> mount: /dev/md2: Invalid argument
> 
> root@host0:/vms/138# mount -t ext2fs /dev/md2s1 /mnt
> mount: /dev/md2s1: Invalid argument
> 
> root@host0:/vms/138# mount -t ext2fs /dev/md2s2 /mnt
> mount: /dev/md2s2: Invalid argument
> 
> root@host0:/vms/138# mount -t ext2fs /dev/md2s5 /mnt
> mount: /dev/md2s5: Invalid argument
> 
> As I understand it, this driver should also read ext3. Maybe bhyve does 
> something meaning the filesystem in the image isn't readable as the 
> installed filesystem of the image, to the host?
> 
> Do you have any other suggestions?

Try:

file -s /dev/md2s1
file -s /dev/md2s2
file -s /dev/md2s5

If I understand correctly, the default Ubuntu partitioning is for 
partition 1 (s1) to be the boot/root partition, partition 2 to be
an "extended" partition which contains partition 5, the swap partition.

It's also possible you used LVM and that could hide the paritions inside
other ones.  FreeBSD can parse LVM if you load the geom_linux_lvm
kernel module.

Regards,

Gary



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161111160909.GA67078>