Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 May 2019 14:33:16 -0700
From:      David Christensen <dpchrist@holgerdanske.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: error when mounting md0 invalid argument
Message-ID:  <c188e828-7f8d-4912-3d11-390bbc56c352@holgerdanske.com>
In-Reply-To: <CAPORhP4dT5KmcPbzO1PL7nGPQfQ_EAR=OTFUrdd-yBy_nSUAWg@mail.gmail.com>
References:  <CAPORhP4dT5KmcPbzO1PL7nGPQfQ_EAR=OTFUrdd-yBy_nSUAWg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 5/31/19 5:29 AM, David Mehler wrote:
> Hello,
> 
> I've got a copy of the FreeBSD 12.0 memstick img file. I'm trying to
> mount it to make some changes to allow it to go serial terminal by
> default. I'm doing:
> 
> mdconfig -a -t vnode -f path/to/img
> and have also added the -u0 option to that line as well.
> 
> An mdconfig -l does indeed show /dev/md0 and file -s /dev/md0 shows
> dos/mbr imgage  I believe that was. I then try:
> 
> mount /dev/md0 /mnt
> 
> and get invalid argument. Nothing in the logs. I've tried
> mount_msdosfs and mount_ufs same result invalid argument.
> 
> Any suggestions appreciated.
> 
> Thanks.
> Dave.

I wanted to make changes to:

     FreeBSD-11.2-RELEASE-amd64-memstick.img


I burned the image to a USB flash drive and then mounted it:

	2019-05-23 14:13:46 toor@ragnar ~
	# camcontrol devlist | grep -i sandisk
	<SanDisk SanDisk Cruzer 8.02>      at scbus5 target 0 lun 0 (da0,pass5)

	2019-05-23 14:16:27 toor@ragnar ~
	# gpart show -p da0
	=>      1  7913470    da0  MBR  (3.8G)
		1     1600  da0s1  !239  (800K)
	     1601  1505616  da0s2  freebsd  [active]  (735M)
	  1507217  6406254         - free -  (3.1G)

	2019-05-23 14:17:24 toor@ragnar ~
	# gpart show -p da0s2
	=>      0  1505616   da0s2  BSD  (735M)
		0       16          - free -  (8.0K)
	       16  1505600  da0s2a  freebsd-ufs  (735M)

	2019-05-23 14:17:53 toor@ragnar ~
	# mount /dev/da0s2a /mnt

	2019-05-23 14:18:04 toor@ragnar ~
	# mount | grep da0s2a
	/dev/da0s2a on /mnt (ufs, local)


The file system reads 100% full, but by working as root I can encroach 
into the reserved space and make changes to the BSD installer:

	2019-05-23 14:18:18 toor@ragnar ~
	# cd /mnt/usr/libexec/bsdinstall

	2019-05-23 14:19:58 toor@ragnar /mnt/usr/libexec/bsdinstall
	# vi zfsboot


If you have more than a little content to add, the proper way would be 
to start at the front end of whatever process creates the image.  (I 
haven't learn that, yet.)


David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c188e828-7f8d-4912-3d11-390bbc56c352>