Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Sep 2015 16:43:34 +0200
From:      Polytropon <freebsd@edvax.de>
To:        "William A. Mahaffey III" <wam@hiwaay.net>
Cc:        FreeBSD Questions !!!! <freebsd-questions@freebsd.org>
Subject:   Re: dd question
Message-ID:  <20150927164334.ccd67f04.freebsd@edvax.de>
In-Reply-To: <5607FA6E.5040600@hiwaay.net>
References:  <5606A4FF.4090105@hiwaay.net> <CA%2BtpaK3UOEfKSfSjbdcH%2BR2jaU9=XVBEg%2B%2Bjn5VCbiiUkLF_Tg@mail.gmail.com> <56073915.6030707@hiwaay.net> <20150927131036.c6b2d9ce.freebsd@edvax.de> <alpine.BSF.2.20.1509270540450.40168@wonkity.com> <5607E84D.1050803@hiwaay.net> <20150927155354.7dab526a.freebsd@edvax.de> <5607F676.10307@hiwaay.net> <20150927160604.f1e1c21d.freebsd@edvax.de> <5607FA6E.5040600@hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 27 Sep 2015 09:22:48 -0453.75, William A. Mahaffey III wrote:
> On 09/27/15 09:12, Polytropon wrote:
> > On Sun, 27 Sep 2015 09:05:52 -0453.75, William A. Mahaffey III wrote:
> >> On 09/27/15 09:00, Polytropon wrote:
> >>> Maybe the installation media, even though on writable media, is
> >>> mounted ro? The easiest thing to capture logs is to perform the
> >>> installation from a "fully writable" live file system, or simply
> >>> mount a network resource r/w.
> >>
> >> How can I figure that out (mounted ro) ? I have ISO's & img's available
> >> on my LAN, can I install from them directly ? If so, how :-) (URL's
> >> welcome) ?
> > Depends on how the boot process is being performed. A look
> > in /etc/fstab or maybe (customized?) rc.diskless could tell
> > you more. Basically, it's simple to boot the media, get to
> > a command line, and look at the "mount -v" output.
> >
> > Another option woule be to use disklabel and and add a new
> > partition, for example letter 'd', which ends at the end
> > of the media (where 'c' usually ends). Note that no partition
> > can be bigger than 'c' ("the whole thing").
> 
> 
> If I use disklabel to add a 'd' slice, will that mess up what is already 
> there ?

It shouldn't. It will add a new partition entry (da0d, for
example) that can be initialized with newfs, so you can then
mount it r/w with UFS.



> What is the syntax for that, I don't see it in the 
> disklabel/bsdlabel man page ?

Take the disklabel editor screen as an example. Make sure
'c' is as big as the whole device, then take the end of
the last partition, 'a', as an offset, and add the desired
size for 'd'.

It will then look comparable to this:

% disklabel ad4s1
# /dev/ad4s1:
8 partitions:
#          size     offset    fstype   [fsize bsize bps/cpg]
  a:    2097152          0    4.2BSD        0     0     0
  b:    4194304    2097152      swap                    
  c:  625142385          0    unused        0     0     # "raw" part, don't edit
  d:    2097152    6291456    4.2BSD        0     0     0
  e:    2097152    8388608    4.2BSD        0     0     0
  f:  104857600   10485760    4.2BSD        0     0     0
  g:   10485760  115343360    4.2BSD        0     0     0
  h:  499313265  125829120    4.2BSD        0     0     0

The size of 'c' is the size of the slice (in this case), and
you can see that "offset" accumulates from the "size" column
of the previous entries.

It's okay to have only 'a', 'c' and 'd' entries, as long as
the math magic adds up properly. :-)



> The man page for disklabel/bsdlabel shows 
> a way to initialize a whole disk using 'fdisk -BI <dev>' & implies that 
> this will create a 'da0s1' slice in the process. However it will also 
> wipe out what is already there.

Invoke the disklabel editor:

	# bsdlabel -e <device>

and make the changes in $EDITOR (yes, it actually uses the
editor program $EDITOR points to). See mdconfig idea following.
I'm not sure if bsdlabel can operate on image files directly.


> If I do that, can I then copy the 
> img-file contents in some way ?

It's probably possible to use mdconfig to turn the image file
into a device file and then modify that device file (add
partitions), resulting in a change of the image file.

	# mdconfig -a -t vnode -u 0 -f image.dd
		(now /dev/md0, /dev/md0a, /dev/md0c should appear)
	# bsdlabel -e /dev/md0
		(make changes, save & exit)
		(and /dev/md0d should appear)
	# mdconfig -d -u 0

Actually, I've never tried that, so it's more of a thought
experiment than an educated and tested advice. :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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