I am working on both, two machines, one with GhostBSD, the second (today) PCBSD. So I tried a lot with the command line gpart(8) like this.
The following steps had to be done, with some success just to get a simple usb-stick to be seen and formatted.
It is about to create a bootable usb-stick with a linux iso for an UEFI machine, to be created on that very one BSD machines.
gpart destroy -F da0
da0 destroyed
newfs_msdos /dev/da0
newfs_msdos: trim 16 sectors to adjust to a multiple of 32
/dev/da0: 2001440 sectors in 62545 FAT16 clusters (16384 bytes/cluster)
BytesPerSec=512 SecPerClust=32 ResSectors=1 FATs=2 RootDirEnts=512 Media=0xf0 FATsecs=245 SecPerTrack=32 Heads=64 HiddenSecs=0 HugeSectors=2001984
I tried
newfs_ext2 /dev/da0
with no success.
This one shows at least what has been done so far
diskinfo -v da0
But any further gpart command results in
gpart add -t pclinuxos64-mate-2016.03-boot -l gpboot -b 40 -s 512K da0
gpart: Invalid number of arguments.
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 da0
gpart: No such geom: da0.
It is an iso of about 795MB, nothing special.
Once again creating the drive (I guess not the slice on it)
gpart create -s gpt da0
da0 created
Make it e UEFI memory stick of a certain size (I took 820MB)
gpart add -t efi -s 820MB da0
da0p1 added
gpart bootcode -b /boot/mbr da0
bootcode written to da0
What comes now is not what I want to!!!! But it is part of that instruction.......
THIS IS WHAT I DON'T WANT FOR SURE, I AM AIMING FOR THAT DISTRO MENTIONED ABOVE!
# gpart add -t freebsd da0
# gpart set -a active -i 1 da0
So should I type like this????
gpart add -t pclinuxos64-mate-2016.03
gpart set -a active -i 1 da0
Here comes a sample how to create a boot.iso (note: I am trying to copy an .iso)
This is taken from Disk Setup On FreeBSD
I did not yet dare to haul it all over, thats why I am asking here.
dd if=/dev/zero of=efiboot.img bs=4K count=100
mdconfig -a -t vnode -f efiboot.img
newfs_msdos -F 12 -m 0xf8 /dev/md0
mount -t msdosfs /dev/md0 /mnt
mkdir -p /mnt/efi/boot
cp loader.efi /mnt/efi/bootx64.efi
umount /mnt
mdconfig -d -u 0
and finally making the ISO image.
makefs -t cd9660 -o bootimage='i386;efiboot.img' -o
no-emul-boot -o rockridge -o lable="UEFItest" -o publisher="test" uefi-test.iso image
I will get me another coffee, later on I will try again the part. This machine does not offer a CD-drive, so it has to be done the hard way. Or I will go to burn a DVD or CD in a netcafe. And last but not least, I want to erase a usb-stick that is already a bootable-usb-drive, but this doesn't work at all with gpart(8).
after a while I came across not only the man pages but some other explanation, that should help, but it doesn't
First create a partition
gpart create -s gpt da0
then having a look
gpart show da0
=>
slicing and dicing a partition
gpart add -t mbr da0
gpart: geom 'da0': Operation not permitted
gpart add -t mbr da0s1
gpart: No such geom: da0s1.
newfs /dev/da0s1
newfs: /dev/da0s1: could not find special device
newfs /dev/da0
newfs: /dev/da0: failed to open disk for writing
This is all I get from the device
gpart list da0
Geom name: da0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 15794142
first: 34
entries: 128
scheme: GPT
Consumers:
1. Name: da0
Mediasize: 8086618112 (7.5G)
Sectorsize: 512
Mode: r0w0e0
After reading that one first delete the slice and then destroy it, even the GEOM label, I did not succeed doing so at all.
and plugging in that very specific usb-stick again and typing
dmesg
umass0: <USBest Technology USB Mass Storage Device, class 0/0, rev 2.00/1.00, addr 3> on usbus7
umass0: SCSI over Bulk-Only; quirks = 0x8100
umass0:5:0:-1: Attached to scbus5
da0 at umass-sim0 bus 0 scbus5 target 0 lun 0
da0: < 0.00> Removable Direct Access SCSI-2 device
da0: Serial Number 09022453564397
da0: 40.000MB/s transfers
da0: 7712MB (15794176 512 byte sectors: 255H 63S/T 983C)
da0: quirks=0x2<NO_6_BYTE>
but fdisk and gpart(8) are not the solution.
later on
unmounting the drive, as usually done in gui of Gpart I typed (note I am on the root terminal command line)
newfs /dev/da0
/dev/da0: 7712.0MB (15794176 sectors) block size 32768, fragment size 4096
using 13 cylinder groups of 626.09MB, 20035 blks, 80256 inodes.
super-block backups (for fsck_ffs -b #) at:
192, 1282432, 2564672, 3846912, 5129152, 6411392, 7693632, 8975872, 10258112,
11540352, 12822592, 14104832, 15387072
great, but it does not accept
newfs_msdos -F32 gpt da0
newfs_msdos: /dev/gpt: No such file or directory
doing this (as mentioned above)
dd if=/dev/zero of=efiboot.img bs=4K count=100
mdconfig -a -t vnode -f efiboot.img
newfs_msdos -F 12 -m 0xf8 /dev/md0
mount -t msdosfs /dev/md0 /mnt
mkdir -p /mnt/efi/boot
cp loader.efi /mnt/efi/bootx64.efi
umount /mnt
mdconfig -d -u 0
getting this
mount -t msdosfs /dev/md0 /mnt
mkdir -p /mnt/efi/boot
cp loader.efi /mnt/efi/bootx64.efi
cp: loader.efi: No such file or directory
umount /mntmdconfig -d -u 0
This remains unsolved, on the list to be done the hard way, just learned that I first delete a slice and afterwards I destroy it. Another laptop and a DVD saved my day. If I find a way to create a bootable usb-stick from a BSD machine to set up a linux image, I put it here.