Need to install FreeBSD on a Linux LVM2 partition

Installing and upgrading FreeBSD.

Need to install FreeBSD on a Linux LVM2 partition

Postby SIG_IGN » 23 Mar 2010, 11:21

Firstly, let me confess I have never used FreeBSd before. and I have Linux LVM setup on my laptop. Currently there are two distros opensuse and Debian (Lenny) installed and they are booting fine with GRUB. I have a two primary partition one for (/boot) and the other is swap. Rest 140 GB is Linux LVM. I have a logical volume of about 25GB free say for example (/dev/lenovo/bsd) . How can I install FreeBSD on this particular partition and configure grub accordingly to boot FreeBSD ? Waiting for some quick comments ,,,, :)
SIG_IGN
Junior Member
 
Posts: 1
Joined: 23 Mar 2010, 11:12

Postby SirDice » 23 Mar 2010, 11:28

SIG_IGN wrote:How can I install FreeBSD on this particular partition and configure grub accordingly to boot FreeBSD ?

Quick and simple answer: you can't.
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
User avatar
SirDice
Old Fart
 
Posts: 16196
Joined: 17 Nov 2008, 16:50
Location: Rotterdam, Netherlands

Postby phoenix » 23 Mar 2010, 21:12

Delete the logical volume. Shrink the volume group by 10GB or so. Shrink the physical volume by the same. And then create a normal, primary partition using the free space. After that, install FreeBSD as per normal into that primary partition.
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
User avatar
phoenix
MFC'd
 
Posts: 3349
Joined: 17 Nov 2008, 05:43
Location: Kamloops, BC, Canada

lvm, fbsd and multiboot system

Postby diablito » 28 Mar 2010, 02:41

this thread prompts further questions. i'd like to set up a fedora, debian, fbsd multiboot system. after wrestling with geom_linux_lvm i finally read this thread (again) and realized that (at my level) using it on pre-existing lvm config is a wee bit more than i can chew. so my fdisk config would be this roughly:

/dev/sda1 200M (to make available as /boot on fedora)
/dev/sda2 200M (" " " " " " debian)
/dev/sda3 ~100G separate primary partition for entire fbsd system
/dev/sda4 205G lvm volume group hosting fedora & debian 100G each and 5G shared swap
unused 100+G room to grow

thoughts & questions:
1. unfortunately no separate /boot partition for fbsd. any drawbacks putting entire system on a single slice, particularly in this instance? purpose of this install is purely educational.

2. unused space on drive (100+G) would be available for expansion if needed. it seems this would be available via lvm or (g)vinum for fedora/debian *and* fbsd respectively. is this correct?

3. ???

TIA for your thoughts �e
diablito
Junior Member
 
Posts: 5
Joined: 28 Mar 2010, 01:34

Grub & *bsd

Postby diablito » 30 Mar 2010, 22:15

SirDice wrote:Quick and simple answer: you can't.


really? with some simple modifications (system id set to 166) of the partition layout i mentioned previously i am booting openbsd from grub just fine. is freebsd so different? entering the following lines in my grub.conf do the trick:

Code: Select all
title *BSD                   #this is the menu selection that appears in grub 
     rootnoverify (hd0,2)    #hd0=1st hard drive, 2=3rd partition which is my OpenBSD slice
     makeactive              #additional commands for grub so that it processes through
     chainloader +1          #its necessary steps.

simpler than i thought.

is freebsd an exception?
diablito
Junior Member
 
Posts: 5
Joined: 28 Mar 2010, 01:34

lvm and GRUB

Postby diablito » 30 Mar 2010, 22:23

apologies. my setup is not booting an lvm partition. i followed phoenix's advice and obtained a successful result.

i am wondering whether loading geom_linux_lvm at boot might not make it possible though...?
diablito
Junior Member
 
Posts: 5
Joined: 28 Mar 2010, 01:34

Postby vermaden » 31 Mar 2010, 06:59

@diablito

It provides read only access to LVM metadata currently:

" wrote:The parser is able to read LVM2 Text Format metadata,
the logical volumes will be assembled and made available
under /dev/linux_lvm/. The metadata is read‐only,
logical volumes cannot be allocated or resized.


@SIG_IGN

You need to give FreeBSD one primary partition, no other options are possible.
Religions, worst damnation of mankind.
"FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM
[FILE][color="DarkSlateBlue"]http://vermaden.blogspot.com[/color][/FILE]
User avatar
vermaden
Giant Locked
 
Posts: 2317
Joined: 16 Nov 2008, 19:37
Location: pl_PL.lodz

Postby dav » 31 Mar 2010, 15:10

diablito wrote:
Code: Select all
title *BSD                   #this is the menu selection that appears in grub 
     rootnoverify (hd0,2)    #hd0=1st hard drive, 2=3rd partition which is my OpenBSD slice
     makeactive              #additional commands for grub so that it processes through
     chainloader +1          #its necessary steps.



I'm curious, why are you using chainloader+1?
dav
Junior Member
 
Posts: 6
Joined: 31 Mar 2010, 12:16

Postby phoenix » 31 Mar 2010, 16:31

diablito wrote:thoughts & questions:
1. unfortunately no separate /boot partition for fbsd. any drawbacks putting entire system on a single slice, particularly in this instance? purpose of this install is purely educational.


FreeBSD doesn't need or use a separate /boot except in some very specific circumstances. Just leave /boot as a directory under the / filesystem.

Using a single slice (fdisk partition) is recommended. Just create your FreeBSD partitions inside of that slice.

2. unused space on drive (100+G) would be available for expansion if needed. it seems this would be available via lvm or (g)vinum for fedora/debian *and* fbsd respectively. is this correct?


FreeBSD can use diskspace that is part of a DOS Extended Partition/Logical Partition just fine. It just can't be installed to a logical partition.
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
User avatar
phoenix
MFC'd
 
Posts: 3349
Joined: 17 Nov 2008, 05:43
Location: Kamloops, BC, Canada

grub

Postby diablito » 31 Mar 2010, 19:55

@ dav: mistake. i did a copy paste and clearly wasnt paying attn. apologies. it works just fine without the chainloader.
diablito
Junior Member
 
Posts: 5
Joined: 28 Mar 2010, 01:34

more on grub

Postby diablito » 31 Mar 2010, 21:26

apologies for excessive posts, wish i could edit them instead (though stating things clearly and correctly the 1st time would also be nice).

@dav: i need to rethink that. the chainloader +1 entry is needed to hand the boot process over to the bsd boot loader. there may be other incantations on grub that would work, but this is the one that worked for me.
diablito
Junior Member
 
Posts: 5
Joined: 28 Mar 2010, 01:34

Postby phoenix » 31 Mar 2010, 22:45

chainloader is the poor-man's way to do it, as there is no intelligence involved. GRUB just loads the first sector of whatever disk/partition it's pointed at, and then passes control over to it. Really only useful for filesystems and kernels that GRUB doesn't understand natively.

For proper support, where GRUB knows what's happening, you specify a proper "root (hd0,3,a)" entry (that points at the a partition inside of the 3 slice inside of the 0 disk, modify as needed for your own disk setup) and a proper kernel entry (pointed at /boot/loader).
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
User avatar
phoenix
MFC'd
 
Posts: 3349
Joined: 17 Nov 2008, 05:43
Location: Kamloops, BC, Canada

Postby dav » 31 Mar 2010, 23:03

Thanks - I thought chainloader was a windows kludge but I wasn't sure.

[ I btw, hve freebsd installed w/ no errors! Once I figure out how to launch it from grub, I'll see if it will boot]
dav
Junior Member
 
Posts: 6
Joined: 31 Mar 2010, 12:16


Return to Installing & Upgrading

Who is online

Users browsing this forum: viniciusferrao and 0 guests