Is it possible to install FreeBSD on a single MBR slice with ZFS ?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Manish Jain-2

Hi,

I always use freebsd-ufs for my installations. But I am interested in
trying freebsd-zfs. My box has a single hard disk, an SSD with 4 MBR slices.

 From what I could gather from the installer, it is not possible to use
freebsd-zfs for / for a single slice. It looks to me like ZFS needs the
whole disk.

Am I wrong ? Is there any way I can get the installer to use ZFS for a
single slice.

Thanks for any information
Manish Jain
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Shamim Shahriar
Hello

I'm not sure why you think zfs needs the entire drive. Most people put it
that way, true, but zfs can work with many different things in the back. On
most of my servers i use multiple partitions (gpt) to isolate swap and tmp,
but keep the positioning scheme (and therefore the size of the partitions)
the same, and let zfs take over the zfs partitions. How this will work at
your end remains to be seen given that you have many different boot blocks.
But if you are happy to try, change the freebsd partition to zfs and see
how it goes. Might find mfsbsf helpful in this regard.

Hope this helps.


On 15 Apr 2017 10:56 am, "Manish Jain" <[hidden email]> wrote:

>
> Hi,
>
> I always use freebsd-ufs for my installations. But I am interested in
> trying freebsd-zfs. My box has a single hard disk, an SSD with 4 MBR
> slices.
>
>  From what I could gather from the installer, it is not possible to use
> freebsd-zfs for / for a single slice. It looks to me like ZFS needs the
> whole disk.
>
> Am I wrong ? Is there any way I can get the installer to use ZFS for a
> single slice.
>
> Thanks for any information
> Manish Jain
> _______________________________________________
> [hidden email] mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-
> [hidden email]"
>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

David Christensen
In reply to this post by Manish Jain-2
On 04/15/2017 02:55 AM, Manish Jain wrote:
> I always use freebsd-ufs for my installations. But I am interested in
> trying freebsd-zfs. My box has a single hard disk, an SSD with 4 MBR slices.
>
>  From what I could gather from the installer, it is not possible to use
> freebsd-zfs for / for a single slice. It looks to me like ZFS needs the
> whole disk.
>
> Am I wrong ? Is there any way I can get the installer to use ZFS for a
> single slice.

AFAIK, the FreeBSD 11.0 installer wants the whole disk if I choose:

     Partitioning                    Auto (ZFS)


My solution was to buy a 16 GB SSD.  Once installed, I moved the image
onto a larger drive.  This seems to work with just a basic install.
(Previous attempts to move an image with Xfce resulted in broken Xfce.)


David

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Manish Jain-2
>>AFAIK, the FreeBSD 11.0 installer wants the whole disk <<

Hi David,

That appears to be my impression too : it simply is not possible to install FreeBSD on an MBR disk
(unless one is willing to use the entire disk).

That is a fairly serious inconvenience : I hate the idea of having to use GPT on my disk because I cannot use the Boot Easy manager (boot0cfg) under GPT. Plus GPT inevitably leads to reckless partitioning.

For disks under and upto 2 TB, MBR is supremely better.

I did manage to get ZFS though, courtesy a spare slice available on my disk.

I installed FreeBSD using UFS on ada0s2 and migrated the setup to a ZFS tank under ada0s3 using the rsync strategy
brilliantly detailed at :

https://imil.net/blog/2016/04/28/Migrate-FreeBSD-root-on-UFS-to-ZFS/

But following the migration, I have made a serious error. I used Windows (ada0s1) to delete ada0s2 :
Windows has rearranged the MBR table to make ada0s3 -> ada0s2. I am now struggling to fix the MBR table.
If you have any tips, that shall be wonderful

Thanks for replying
Manish Jain

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Polytropon
On Mon, 17 Apr 2017 13:45:25 +0000, Manish Jain wrote:
> >>AFAIK, the FreeBSD 11.0 installer wants the whole disk <<
>
> Hi David,
>
> That appears to be my impression too : it simply is not possible
> to install FreeBSD on an MBR disk
> (unless one is willing to use the entire disk).

That's not correct.

If you go with MBR, you usually need _one_ slice unoccupied. This
is where you install FreeBSD partitions to (which then carry the
file systems or act as swap space).

Example:

ada0 = the whole disk
ada0s1 = 1st slice, contains some "Windows"
ada0s2 = 2nd slice, contains maybe DOS
ada0s3 = 3rd slice, contains FreeBSD
ada0s3a = FreeBSD / file system
ada0s3b = FreeBSD swap space
ada0s3[d-h] = some more FreeBSD file system
ada0s4 = 4th slice, still empty

This example of course applies to UFS. If you use ZFS, it should
be possible to give ada0s3 to FreeBSD ZFS, but of course there would
not be any BSD partitions inside.



> That is a fairly serious inconvenience : I hate the idea of having
> to use GPT on my disk because I cannot use the Boot Easy manager
> (boot0cfg) under GPT. Plus GPT inevitably leads to reckless
> partitioning.

Do not confuse MBR and GPT. Both can be used for "whole disk as a
whole" or "many small partitions". But you are right that there may
be situations where multiboot-environments require specific hacks
to get working.

For comparison, check this article:

http://www.wonkity.com/~wblock/docs/html/disksetup.html



> For disks under and upto 2 TB, MBR is supremely better.

Or GPT - it actually does not matter. Today, GPT is advised unless
you have a good and valid reason to use MBR.

Or you use _none_ of them, no GPT, no MBR. This approach is called
"dedicated" and does not involve any disk partitioning, only BSD
partitions (ada0[a-h] to follow the example provided above). This
of course is not really a good idea for multiboot environments.



> I did manage to get ZFS though, courtesy a spare slice available
> on my disk.

That is a fully valid approach.



> I installed FreeBSD using UFS on ada0s2 and migrated the setup
> to a ZFS tank under ada0s3 using the rsync strategy
> brilliantly detailed at :
>
> https://imil.net/blog/2016/04/28/Migrate-FreeBSD-root-on-UFS-to-ZFS/

That "UFS to ZFS" approach is also possible if you can't (or don't
want to) install ZFS right from the start.



> But following the migration, I have made a serious error. I used
> Windows (ada0s1) to delete ada0s2 :
> Windows has rearranged the MBR table to make ada0s3 -> ada0s2.

Sounds like something OS/2 has done to me many years ago. :-)



> I am now struggling to fix the MBR table.

Of course.



> If you have any tips, that shall be wonderful

Do not and never use "Windows" to deal with lower level aspects of
your disk. It will for sure mess things up, and in worst case, you
need to reinstall everything from scratch. Of course you don't, as
you have a working backup you can rely on. ;-)

It's not as easy anymore to fix partition table entries with a simple
handheld calculator and "Norton Disk Editor" started from a handy DOS
boot floppy. :-)

For the future: Bootable CDs like UBCD or PartEd Magic provice
excellent tools to deal with re-partitioning. You can use FreeBSD's
editor as well, especially if all you want to do is delete some
MBR slices. It's the first thing you do in the installer, then
follow to create new slices as you need them, and go on with the
installation process.



--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Tim Daneliuk
On 04/17/2017 06:49 PM, Polytropon wrote:
> It's not as easy anymore to fix partition table entries with a simple
> handheld calculator and "Norton Disk Editor" started from a handy DOS
> boot floppy. :-)

Those memories ... Argggggggg.

(Note Readers:  If you do not know what the aforementioned means, you don't
want to know.  If you do know, you want to forget ...)

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Thomas Mueller-6
In reply to this post by Polytropon
(snip)

> > But following the migration, I have made a serious error. I used
> > Windows (ada0s1) to delete ada0s2 :
> > Windows has rearranged the MBR table to make ada0s3 -> ada0s2.

> Sounds like something OS/2 has done to me many years ago. :-)



> > I am now struggling to fix the MBR table.

> Of course.



> > If you have any tips, that shall be wonderful

> Do not and never use "Windows" to deal with lower level aspects of
> your disk. It will for sure mess things up, and in worst case, you
> need to reinstall everything from scratch. Of course you don't, as
> you have a working backup you can rely on. ;-)

> It's not as easy anymore to fix partition table entries with a simple
> handheld calculator and "Norton Disk Editor" started from a handy DOS
> boot floppy. :-)
       
> For the future: Bootable CDs like UBCD or PartEd Magic provice
> excellent tools to deal with re-partitioning. You can use FreeBSD's
> editor as well, especially if all you want to do is delete some
> MBR slices. It's the first thing you do in the installer, then
> follow to create new slices as you need them, and go on with the
> installation process.

> Polytropon

With either gpart or Rod Smith's gdisk, and I believe also NetBSD's gpt, you can save the GPT partition table data to a file, preferably on a different disk, such as a USB stick, and restore if the GPT partition table is damaged.

Backup partition-table data file would have to be restored from the same partitioning software.

This requires a USB-stick or other off-disk installation of FreeBSD that would include gpart or gdisk; gdisk also can be used under Linux.

This would be better than Norton Disk Editor + handheld calculator + DOS boot floppy.

Your mention of OS/2 reminds me that this month, or about 10 days ago, marks the sixteenth anniversary of the crash with OS/2 Warp 4.  On rebooting, OS/2 CHKDSK ran automatically and ran amok, trashing all data on my second hard drive in addition to partition data on the smaller, first hard drive.

I was never able to boot OS/2 again, even from maintenance or installation floppies, result was Trap 000e or Trap 000c.

I believe OS/2 Warp 4 had better hardware support than FreeBSD or NetBSD back then, 16 years ago, but since then OS/2 and its successor, eComStation, have not kept up, and now FreeBSD and NetBSD seem to be far ahead of eComStation.

Tom

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Manish Jain-2
In reply to this post by Polytropon


>>
>> That appears to be my impression too : it simply is not possible
>> to install FreeBSD on an MBR disk
>> (unless one is willing to use the entire disk).
>>

>
> That's not correct.
>

Sorry for the confusion. What I meant was "'That appears to be my impression too : it simply is not possible
to install FreeBSD+ZFS on an MBR slice".

Of course, I have been installing FreeBSD+UFS on a single slice from my very first days in 2002  : - )
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

Polytropon
In reply to this post by Thomas Mueller-6
On Tue, 18 Apr 2017 01:28:33 +0000, Thomas Mueller wrote:
> With either gpart or Rod Smith's gdisk, and I believe also
> NetBSD's gpt, you can save the GPT partition table data to
> a file, preferably on a different disk, such as a USB stick,
> and restore if the GPT partition table is damaged.

With GPT's metadata, it is more complicated. But if you have
a MBR layout, you can simply copy the partition table using
dd to a file (stored on a USB stick, for example), and dd it
back in case of trouble (bootable USB stick).



> Backup partition-table data file would have to be restored
> from the same partitioning software.
>
> This requires a USB-stick or other off-disk installation of
> FreeBSD that would include gpart or gdisk; gdisk also can be
> used under Linux.
>
> This would be better than Norton Disk Editor + handheld
> calculator + DOS boot floppy.

Keep in mind this is a _historical_ note from a time when
there was no USB, no bootable USB, no gpart or other tools.
No Internet. Only DOS. And floppies. And Norton was Norton
(not "The Yellow Plague" as the name suggests today). ;-)



> Your mention of OS/2 reminds me that this month, or about 10
> days ago, marks the sixteenth anniversary of the crash with
> OS/2 Warp 4.  On rebooting, OS/2 CHKDSK ran automatically and
> ran amok, trashing all data on my second hard drive in addition
> to partition data on the smaller, first hard drive.

In my case, it was the OS/2 installer: Instead of using the
prepared 4th slice ("DOS primary partition"), it somehow
messed up the 1st slice, then run amok, and rebooted. With
a DOS boot disk, I found out that C: had D:'s content, D:
had E:'s content, but the original content of C: was gone.

_This_ is where NDD + calculator + pencil + paper got me all
my data on C: back. As a result, C:, D: and E: were present
as before the installation, and there was one unformatted
partition F:. But I never tried OS/2 on that disk again,
it got its own disk - and installed without any problems. :-)




--
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to install FreeBSD on a single MBR slice with ZFS ?

David Christensen
In reply to this post by Manish Jain-2
On 04/17/2017 06:45 AM, Manish Jain wrote:
>>> AFAIK, the FreeBSD 11.0 installer wants the whole disk <<
>
> Hi David,
>
> That appears to be my impression too : it simply is not possible to
> install FreeBSD on an MBR disk (unless one is willing to use the
> entire disk).

Using the FreeBSD 11.0 i386 installer and choosing "Partitioning" ->
"Auto (ZFS)", I was able to obtain an MBR partition table with one
primary partition (BSD slice).  I then used Debian GNU/Linux to move the
entire system image from the 16 GB SSD to an 80 GB HDD:

root@p43400e:~ # gpart show
=>       63  156355521  ada0  MBR  (75G)
          63          1        - free -  (512B)
          64   31277160     1  freebsd  [active]  (15G)
    31277224  125078360        - free -  (60G)

=>       0  31277160  ada0s1  BSD  (15G)
          0   4194304       1  freebsd-zfs  (2.0G)
    4194304   4194304       2  freebsd-swap  (2.0G)
    8388608  22888544       4  freebsd-zfs  (11G)
   31277152         8          - free -  (4.0K)


> That is a fairly serious inconvenience : I hate the idea of having to
> use GPT on my disk because I cannot use the Boot Easy manager
> (boot0cfg) under GPT. Plus GPT inevitably leads to reckless
> partitioning.
>
> For disks under and upto 2 TB, MBR is supremely better.
>
> I did manage to get ZFS though, courtesy a spare slice available on
> my disk.
>
> I installed FreeBSD using UFS on ada0s2 and migrated the setup to a
> ZFS tank under ada0s3 using the rsync strategy brilliantly detailed
> at :
>
> https://imil.net/blog/2016/04/28/Migrate-FreeBSD-root-on-UFS-to-ZFS/
>
> But following the migration, I have made a serious error. I used
> Windows (ada0s1) to delete ada0s2 : Windows has rearranged the MBR
> table to make ada0s3 -> ada0s2. I am now struggling to fix the MBR
> table. If you have any tips, that shall be wonderful


I tried multi-boot years ago -- it was a PITA.  I have invested in extra
system drives and mobile docks.  Each of my system drives has exactly
one operating system image:

https://www.startech.com/HDD/Mobile-Racks/35in-Trayless-Hot-Swap-SATA-Mobile-Rack-for-Dual-25in-Hard-Drives~HSB225SATBK

https://www.startech.com/HDD/Mobile-Racks/Black-Serial-ATA-Drive-Drawer-with-Shock-Absorbers-Professional-Series~DRW115SATBK


David
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: Is it possible to create ZFS tank on USB media ?

David Christensen
In reply to this post by Manish Jain-2
On 04/17/2017 12:34 PM, Manish Jain wrote:
> Being new to ZFS, I wonder if is possible to create ZFS root on
> removable media like a USB pen drive ?

One of my favorite tricks is to use the Debian GNU/Linux installer to
install to a (BIOS, MBR) 16 GB USB 3.0 flash drive -- for use as a
poor-man's SSD for low-end machines, as a "portable" desktop, as a
"rescue/repair/test" live image, etc.  I have a couple USB flash drives
with Debian 7; I need to try it with Debian 8.


It's been a couple of years since I tried installing FreeBSD onto a USB
flash drive using the FreeBSD installer.  The last time I tried,
apparently such was not supported.  Various readers of this mailing list
suggested various techniques for installing by hand, but I was then, and
still would be now, looking for an OOTB KISS solution.


> Logically, it sounds pretty cool - and a convenient way of migrating
> with just a single MBR slice available :
>
> a) create a ZFS tank on USB
> b) rsync your installation to ztank
> c) boot from USB
> d) create a second tank : this time on the slice that originally was UFS
> e) rsync ztank to ztank2
>
> Is that too weird ? Impossible ? Thanks for shedding any light.

I don't know enough FreeBSD or ZFS to comment.


> (As already mentioned in a post I just made to f-q, my MBR slice index
> corruption has been taken care of - by - of all people - Microsoft,  : - )
>
> I used Windows to create a new slice, a Windows reshuffled the slice
> indexes to pack them in the normal order).

I still prefer and recommend one OS per system disk.  The USB flash
drive trick is ideal for computers with space for only one drive, such
as laptops.


David



_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[hidden email]"