Date: Mon, 21 Jan 2013 16:08:28 +0200 From: Andriy Gapon <avg@FreeBSD.org> To: lev@FreeBSD.org Cc: d@delphij.net, Xin Li <delphij@delphij.net>, freebsd-geom@FreeBSD.org Subject: Re: Is it possible to run gpart and newfs on file without root access (without mdconfig)? Message-ID: <50FD4BDC.4010300@FreeBSD.org> In-Reply-To: <1455320447.20130121104850@serebryakov.spb.ru> References: <1839155364.20130119150146@serebryakov.spb.ru> <50FBAB86.20602@delphij.net> <1455320447.20130121104850@serebryakov.spb.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
on 21/01/2013 08:48 Lev Serebryakov said the following:
> Hello, Xin.
> You wrote 20 января 2013 г., 12:32:06:
>
> XL> makefs?
> It is second step. Here are several problems:
>
> (1) makefs doesn't create any partition tables / labels.
> (2) makefs could not "inject" its image into file with partition
> tables / labels.
>
> makefs is good to create FS and make permission fixups (by mtree
> file,generated with root-less install) in one step, but it doesn't
> solve whole problem of full disk image creation, as far as I
> understand.
>
I once used the following trick to create a simple partition table (dangerously
dedicated?) inside a makefs built image:
makefs -b '10%' -o label="${LABEL}",version=1 base.ufs R/
bsdlabel -w -B -b R/boot/boot -f base.ufs
_label_file=$(mktemp labelXXXXXX)
bsdlabel -f base.ufs | sed -e '/ a:/s/unused/4.2BSD/' -e '/ a:/s/ 16 / 0 /' >
${_label_file}
bsdlabel -R -f base.ufs ${_label_file}
rm -f ${_label_file}
I would be more happy to have gpart-in-userland :-)
--
Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50FD4BDC.4010300>
