2e4a4
![]() |
|
|
|
|
|||||||
| Howtos & FAQs (Moderated) Would you like to share some of your solutions for certain problems? Tips or tricks? Post here. All new topics are automatically moderated. |
![]() |
|
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
All these years sysinstall(8) was helping us to install FreeBSD with most options we needed, today with new filesystems/features like GJournal/ZFS/Geli/GMirror/GStripe its no longer up to the task, because it only supports creating installation on UFS filesystem with SoftUpdates turned ON or OFF.
In this guide you will learn how to setup FreeBSD installation in simple yet flexible setup based on read-only UFS (without SoftUpdates) for 'base system' [1], some SWAP space, /tmp mounted on SWAP and all the other filesystems (/var /usr ...) mounted on ZFS. It will not require rebuilding anything, just simple setup on plain MBR partitions. I should also mention that we would be using AHCI mode for disks. I also provided two versions, for system with one harddisk and with three of them for redundant setup. Here is the layout of the system with 1 harddisk: Code:
MBR SLICE 1 | / | 512 MB | UFS/read-only
| SWAP | 2 GB |
| /tmp | 512 MB | mounted on SWAP with mdmfs(8)
------------+------+---------------------------------------
MBR SLICE 2 | /usr | REST | ZFS dataset
| /var | REST | ZFS dataset
Code:
MBR SLICE 1 | / | 512 MB | UFS/read-only
------------+------+--------+------------------------------
MBR SLICE 2 | SWAP | 1 GB |
| /tmp | 512 MB | mounted on SWAP with mdmfs(8)
------------+------+--------+------------------------------
MBR SLICE 3 | /usr | REST | ZFS dataset
| /var | REST | ZFS dataset
Code:
[ DISK0 ] [ DISK1 ] [ DISK2 ] [ / ] < RAID1 > [ / ] < RAID1 > [ / ] [ SWAP0 ] [ SWAP1 ] [ SWAP2 ] [ Z ] < RAID5 > [ F ] < RAID5 > [ S ] You will need *-dvd-* disk or *-memstick-* image for this installation, *-disk1-* will not do since it does not contain livefs system. Here is the procedude, described as simple as possible. 1.0. I assume that our disk for the installation would be /dev/ad0 (/dev/ad0 /dev/ad1 /dev/ad2 for system with 3 disks) 1.1. Boot *-dvd-* from DVD disk or *-memstick-* image from pendrive 1.2. Create your temporary working environment 1.3. Load needed modules 1.4. Create/mount needed filesystems 1.5. Actually install needed FreeBSD sets
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
| The Following 16 Users Say Thank You to vermaden For This Useful Post: | ||
depayns (February 23rd, 2011), dewarrn1 (April 4th, 2010), edhunter (April 19th, 2010), gnemmi (April 5th, 2010), GoksinAkdeniz (May 9th, 2010), ikbendeman (October 13th, 2010), lme@ (June 2nd, 2010), magistr (April 24th, 2010), nix (October 25th, 2010), overmind (February 16th, 2011), rabfulton (June 28th, 2010), tempo (January 20th, 2012), Unixworld (May 7th, 2011), vand777 (January 29th, 2011), vertexSymphony (June 15th, 2010), zeissoctopus (October 28th, 2011) | ||
|
#2
|
||||
|
||||
|
1.6. Provide basic configuration needed to boot new system
1.6.1. 1.6.1. 1.7. Unmount filesystems and reboot Now lets talk things you will need to do after reboot. 2.0. At boot loader select boot into single user mode 4. Boot FreeBSD in single user mode2.1. Login as root without password 2.2. Set root password 2.3. Set hostname 2.4. Set timezone and date/time 2.5. Tune the ZFS filesystem (only for i386) 2.6. Mount /tmp on SWAP 2.7. Move termcap into /etc (instead of useless link on crash) 2.8. Add latest security patches 2.9. Make all changes to configuration in /etc, then set / to be mounted read-only in /etc/fstab 2.10. Reboot and enjoy modern install of FreeBSD system
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com Last edited by vermaden; April 9th, 2010 at 08:28. |
| The Following 8 Users Say Thank You to vermaden For This Useful Post: | ||
Caliante (April 5th, 2010), edhunter (April 19th, 2010), gnemmi (April 5th, 2010), GoksinAkdeniz (May 9th, 2010), magistr (April 24th, 2010), Unixworld (May 7th, 2011), z0ran (May 2nd, 2011), zeissoctopus (October 28th, 2011) | ||
|
#3
|
||||
|
||||
|
To summarise, this setup provides us these things:
-- bulletproof 'base system' [1] on UFS (w/o SU) mounted read-only CHANGELOG 1.0 / 2010-01-14 / initial version 1.1 / 2010-01-15 / simplified PATH +fixit# setenv PATH /mnt2/rescue:/mnt2/usr/bin1.2 / 2010-01-15 / added link for termcap (instead of duplicate on /etc and /usr) [2.6.] .# rm /etc/termcap1.3 / 2010-01-21 / removed unneeded mount commands [2.0.] -# zfs mount basefs/var1.4 / 2010-03-08 / added setup for 3 disks + cleanup too much to fit here, we can as well call this new version RELOADEDMIRROR THREAD: http://daemonforums.org/showthread.php?t=4200 POLISH VERSION: http://bsdguru.org/dyskusja/viewtopic.php?t=19392 ADDED: 2010/10/21 After rethinking setup from my HOWTO and after phoenix thoughts I currently use that setup for most FreeBSD installations that include ZFS. LOGICAL SETUP Code:
UFS 512m / ro ZFS * /home rw | atime=off RAM 128m /tmp rw | async UFS * /usr ro | softupdates (mounted r/w only for packages updates) ZFS * /usr/obj rw | atime=off | checksum=off ZFS * /usr/ports rw | atime=off ZFS * /usr/src rw | atime=off ZFS * /var rw UFS 128m /var/db/pkg ro | softupdates (mounted r/w only for packages updates) Code:
p1 8g disk0s1a 512m UFS / newfs -m 1 /dev/label/root
disk0s1e 128m UFS /var/db/pkg newfs -m 1 -U /dev/label/pkg
disk0s1f * UFS /usr newfs -m 1 -U /dev/label/usr
p2 *g disk0s2 ZFS/home zfs create -o mountpoint=/home pool/home
ZFS/var zfs create -o mountpoint=/var pool/var
ZFS/usr zfs create -o mountpoint=none pool/usr
ZFS/usr/src zfs create -o mountpoint=/usr/src pool/usr/src
ZFS/usr/obj zfs create -o mountpoint=/usr/obj pool/usr/obj
ZFS/usr/ports zfs create -o mountpoint=/usr/ports pool/usr/ports
(if You need SWAP, omit on CF/Pendrive/SSD disks)
ZFS/SWAP zfs create -V 2g pool/swap
RAM/SWAP 128m /tmp tmpmfs=YES --> /etc/rc.conf
Code:
8g CF disk0s1a 512m UFS / newfs -m 1 /dev/label/root
disk0s1e 128m UFS /var/db/pkg newfs -m 1 -U /dev/label/pkg
disk0s1f * UFS /usr newfs -m 1 -U /dev/label/usr
*g ZFS ZFS/home zfs create -o mountpoint=/home pool/home
ZFS/var zfs create -o mountpoint=/var pool/var
ZFS/usr zfs create -o mountpoint=none pool/usr
ZFS/usr/src zfs create -o mountpoint=/usr/src pool/usr/src
ZFS/usr/obj zfs create -o mountpoint=/usr/obj pool/usr/obj
ZFS/usr/ports zfs create -o mountpoint=/usr/ports pool/usr/ports
(if You need SWAP)
ZFS/SWAP zfs create -V 2g pool/swap
128M RAM /tmp tmpmfs=YES --> /etc/rc.conf
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com Last edited by vermaden; October 21st, 2010 at 18:55. |
| The Following 5 Users Say Thank You to vermaden For This Useful Post: | ||
gnemmi (April 5th, 2010), GoksinAkdeniz (May 9th, 2010), Unixworld (May 7th, 2011), zeissoctopus (October 28th, 2011), zeroseven (October 22nd, 2010) | ||
|
#4
|
||||
|
||||
|
hmm, are you able to boot into single user mode with ZFS?
I can't for some reason, maybe because my HDD's are encrypted. But there are devices with eli (decrypted), weird |
|
#5
|
||||
|
||||
|
@killasmurf86
/ is on UFS (with bsdlabel) so no problem to boot into single user mode, I havent played with encrypted / to check here, maybe I will in some free time @ virtualbox.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#6
|
||||
|
||||
|
Encrypted root with UFS will work
, bin there done that
|
|
#7
|
|||
|
|||
|
First off, thanks to Vermaden for posting this! It's a very slick way to take advantage of the best filesystems that FreeBSD offers. I'm considering migrating a home server to 8.0, and this seems like a great setup for me. I've got a couple of questions before I give it a try, though.
First, would including a fourth disk be as simple as it looks? I've got 7.2's ZFS spanning 3 disks at the moment, but I've got a fourth sitting around and figure that it might as well be in the server. Second, do you have any recommendations for maintaining data integrity during the move? I've got external HDD's that can hold all of my stuff, but they're just FAT32 and lack the kind of checksum protection that ZFS is giving me on the current system. My plan would be to use all three of the current disks and a fourth in the new system, but that will require wiping out the current filesystem. Thanks in advance! |
|
#8
|
||||
|
||||
|
@dewarrn1
Quote:
Quote:
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
| The Following User Says Thank You to vermaden For This Useful Post: | ||
dewarrn1 (April 4th, 2010) | ||
|
#9
|
|||
|
|||
|
Very cool, I'll get that process underway. I'll probably generate some par2 data for those split tar files as well, just in case. Thanks!
|
|
#10
|
|||
|
|||
|
This worked almost exactly as advertised! I ended up with 4x500GB HDDs with a 4-way mirrored base system, 4 GB swap spread across the disks, and ~1.3TB ZFS. My only hiccup was the "zpool import -D" bit, which for some reason didn't want to play nice. However, "zpool import basefs" did the trick, and now I'm getting things back onto ZFS. Nice work, V!
|
|
#11
|
||||
|
||||
|
Quote:
![]() The first version included zpool import basefs, but after messing with 3 disks it imported with zpool import -D so I changed the formula, I think I will include both just in case, thanks.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#12
|
|||
|
|||
|
I've used your guide and had the same problem as dewarrn1 when trying to import the pool (
zpool import -D), but zpool import basefs did the trick here as well ![]() Oh, I installed the system on 2 drives and used raid1 for all the slices (/, /usr and /var). I plan to add another disk in the future and I will keep you updated how the process of adding another disk to the zfs pool goes. Anyway, great guide. Last edited by DutchDaemon; April 17th, 2010 at 18:44. Reason: use proper posting tags |
|
#13
|
||||
|
||||
|
Quote:
Thanks mate.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#14
|
|||
|
|||
|
Dear vermaden or anybody,
would it be possible/prudent to modify the installation to have the entire / (USB) and /usr (ZFS) on one (mirrored) disk, in particular flash and having the rest of the file system, i.e., SWAP, /tmp, /var, /home, etc., on RAIDed hard drives using ZFS? The motivation would be to further separate the OS/Application (fairly static on my system) from the data. Thank you, M |
|
#15
|
||||
|
||||
|
Quote:
P.S. Are you from Latvian Linux center? |
|
#16
|
||||
|
||||
|
@mefizto
If You want both / and /usr on separate disks/USB then it would be better, to create RAID 1 with gmirror on that USB drives, and use UFS for /usr on that USB disk, and then put all other filesystems with swap on remaining harddisks.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#17
|
|||
|
|||
|
Dear killasmurf86,
thank you for the reply. And, no, I am not from Latvian Linux center. Dear vermaden, Code:
. . .it would be better, to create RAID 1 with gmirror on that USB drives, . . . Code:
. . .use UFS for /usr on that USB disk. . . If it is not much bother, could you indicate, at least in general terms, which parts of your procedure have to be changed? Thank you, M |
|
#18
|
||||
|
||||
|
Quote:
About changes, You would have to create additional UFS partition (e) for /usr of course in section 1.4: Code:
# cat > label << __EOF__ # /dev/ad0s1: 8 partitions: a: 512m 0 4.2BSD e: * * 4.2BSD __EOF__
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#19
|
|||
|
|||
|
Dear vermaden,
thank you for your help. Kindest regards, M |
|
#20
|
||||
|
||||
|
@mefizto
You are welcome mate.
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#21
|
||||
|
||||
|
Great guide vermaden. Worked out perfect setting the system bottom up on a new laptop.
|
|
#22
|
||||
|
||||
|
@Daisuke_Aramaki
Thanks 'n' Welcome
__________________
Religions, worst damnation of mankind. "FreeBSD has always been the operating system that GNU/Linux should have been." Frank Pohlmann, IBM http://vermaden.blogspot.com |
|
#23
|
|||
|
|||
|
Code:
DISKS: 3
# cat > part << __EOF__
p 1 165 63 512M
p 2 165 * 1024M
p 3 159 * *
p 4 0 0 0
a 1
__EOF__
# fdisk -f part ad0
# fdisk -f part ad1
# fdisk -f part ad2
what would I change here? because this is not working for me; I understand fdisk -f part ad4 would be the right command but when I do that I get this error: Code:
******* Working on device /dev/ad4 ******* fdisk: invalid fdisk partition table found fdisk: geom not found: "ad4" Last edited by DutchDaemon; June 1st, 2010 at 14:48. Reason: use [code], not [quote] |
|
#24
|
|||
|
|||
|
So it looks like I found that I was not using the full path to add the kernel modules and was getting an error that I over looked.. hence why it could not find ad4; *blush* my bad..
So after that I was able to finish the install but when I get to the 'reboot in single user mode' I have some issues.. I have a usb keyboard and can not use the keyboard at boot time; odd.. when it boots I get the mountroot> prompt; also odd.. but when I look back through dmesg I do not see my (ad4, ad6, ad8, ad10) but rather I see ada0, ada1, ada2, ada3.. I am assuming that has *something* to do with ahci (something I've not used yet) so what do I do with that? Code:
# fdisk -f part ada0 # fdisk -f part ada1 # fdisk -f part ada2 # fidsk -f part ada3 thanks in advance. Last edited by DutchDaemon; June 1st, 2010 at 14:48. |
|
#25
|
|||
|
|||
|
I may be partially in the wrong place to ask this question. I have a sparc64 system and before I set myself up for a lot of desk to face action, I was wondering if I could accomplish this sort of install using the livefs in combination with disk1?
|
![]() |
| Tags |
| zfs |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Minimal install of Xorg - howto? | cpcnw | X.Org | 26 | April 22nd, 2012 06:23 |
| HOWTO: Modern FreeBSD Install (vermaden way) | vermaden | Howtos & FAQs (Moderated) | 92 | February 8th, 2011 23:03 |
| howto install freeBSD on iMac/howto boot from CD | leizhenhua | Other Architectures | 1 | June 15th, 2009 06:09 |
| HOWTO: Install and setup MLDonkey on FreeBSD | tangram | Howtos & FAQs (Moderated) | 0 | November 17th, 2008 11:30 |