apart difficulties

Roberto Fernández roberfern at gmail.com
Tue Oct 17 07:02:22 UTC 2017


Hi Cristopher,

before starting I was wandering why have you chose a MBR partitioning
scheme instead of a GPT one, but never the less, I will try to help
you with that.

2017-10-17 6:13 GMT+02:00 Christopher Bowman <crb at chrisbowman.com>:
> I have a home server with a fairly large amount of zfs disk space where I keep all of my persistent data.  As a result when new releases of FreeBSD come out I tend backup the root images of my machines to the zfs pool and, starting with the least important box, I blow away all the local partitions and reinstall from scratch.  Then I mount the server zfspool and restore config files and packages.  As a result my machines stay pretty up to date and clean.  Lately rather than burning DVDs I’ve decided that I will create a usb boot disks containing the entire DVD contents and simply go down the line and and install on one machine after the other.  My machine can now all boot off USB but don’t all have DVD drives.
>
> I have the following script below which I was using to try configure an MBR bootable memory stick.  The commented out lines are a reminder to myself of how to copy over the ISO contents to the slice I create (I only do this when there is a new release so I forget.)
>
> gpart create -s MBR da0
> gpart add -i 1 -t freebsd da0
> gpart set -a active -i 1 da0
> gpart bootcode -b /boot/mbr da0
> gpart create -s BSD -n 8 da0s1
> gpart add -t freebsd-ufs -i 1 da0s1
> gpart bootcode -p /boot/boot -i 1 da0s1

If you do here the following (instead of what you did above) should
work just fine:
gpart create -s GPT da0
gpart add -i1 -s 256k -t freebsd-boot -b 40 da0
gpart add -i2 -t freebsd-ufs da0
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 da0

If you insist in having a BSD partitioning inside a MBR one, I should
took a deeper look into the code and analyze why it is not working as
it should.

> # newfs da0s1a
> # mount /dev/da0s1a /mnt/usb
> # mdconfig -a -t vnode -f /u1/ISOs/FreeBSD/11.1/FreeBSD-11.1-RELEASE-amd64-dvd1.iso
> # mount -t cd9660 /dev/md0 /mnt/dvd
> # cp -pr /mnt/dvd/* /mnt/usb
> # umount /mnt/usb
>
> What I’ve found that’s interesting is that the slice creation doesn’t seem to be persistent.  By that I mean that if I run the above script (included the commented stuff.)  I can clearly see the /mnt/usb contents are the same as the DVD.  If I then unmount /mnt/usb and remove the stick when I put it back in gpart show doesn’t seems to show the BSD label, just the MBR slice
>
> If I reinsert and do the following:
> gpart create -s BSD -n 8 da0s1
> gpart add -t freebsd-ufs -i 1 da0s1
> gpart bootcode -p /boot/boot -i 1 da0s1
> fsck /dev/da0s1a
> mount /dev/da0s1a /mnt/usb
>
> Then the file system is there just as before.  The slice creation doesn’t seem persistent.  Am I missing something?  Is there something I have to do to commit the slice?  Is this a bug?
>
> I appreciate your help.
>
> Christopher
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"


More information about the freebsd-hackers mailing list