How can I safely use gpart() to partition a disk that already contains another OS that I don't want to get rid of?
In my case, I'd like to dual boot Windows 8 and FreeBSD 10 on my HDD. I'm already dual booting Windows 8 and Linux on the drive, so I've already shrunk the Windows 8 partition; disabled SecureBoot, FastBoot, and QuickBoot; and already have an EFI System Partition (ESP). I want to replace Linux with FreeBSD.
Since I'm dual booting, I don't want to destroy the GPT table (
How do I make FreeBSD use the existing ESP? When it comes time to installing a boot loader, do I just install it to the ESP and that's that?
If I want to backup all the GPT data, should I dd() the ESP, the beginning of the disk (how much), and the end of the disk (how much)? Or will
I want to use ZFS with geli() encryption, so I assume I need to do the following:
(just having the one default dataset is fine for me for now)
Please correct me if I'm wrong.
Thanks!
In my case, I'd like to dual boot Windows 8 and FreeBSD 10 on my HDD. I'm already dual booting Windows 8 and Linux on the drive, so I've already shrunk the Windows 8 partition; disabled SecureBoot, FastBoot, and QuickBoot; and already have an EFI System Partition (ESP). I want to replace Linux with FreeBSD.
Since I'm dual booting, I don't want to destroy the GPT table (
gpart destroy -F <device>); that sounds dangerous. I want to modify the existing GPT table. Would I use gpart delete for each Linux partition, and then gpart add the FreeBSD partitions I need? Is gpart destroy and gpart create unnecessary in my case?How do I make FreeBSD use the existing ESP? When it comes time to installing a boot loader, do I just install it to the ESP and that's that?
If I want to backup all the GPT data, should I dd() the ESP, the beginning of the disk (how much), and the end of the disk (how much)? Or will
gpart backup take care of all that for me (and I'll move the backup to a USB)?I want to use ZFS with geli() encryption, so I assume I need to do the following:
Code:
gpart delete the Linux partitions.
gpart add -t freebsd-boot -s 512K <device>
gpart add -t freebsd-swap -s 4G <device>
gpart add -t freebsd-zfs <device>
gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i <index_of_freebsd-boot_partition> <device>
geli init [options] <freebsd-zfs_partition>
geli attach <freebsd-zfs_partition>
zpool create <name> <eli_partition>
Please correct me if I'm wrong.
Thanks!