LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 09-06-2015, 02:57 PM   #1
grahamh68
LQ Newbie
 
Registered: Jan 2010
Location: UK
Distribution: Fedora & CentOS
Posts: 8

Rep: Reputation: 1
CentOS Root Filesystem on ZFS


Does anyone have any experience of mounting the root filesystem of CentOS 6 on ZFS?

OK, so I've been at this a while now and I'm so close (I think), but I just can't get the boot process to mount root from ZFS. Just to complicate things I'm using a 3.18 kernel from XEN4CentOS.

I've grabbed the tar files for SPL & ZFS and got them compiling ok with DKMS - no problems there, created ZPOOL and ZFS dataset for root and rebuilt initramfs (I think) from a copy of the root filesystem on ZFS... and that's where I gut stuck.

I'm not really sure what to put into grub.conf or if everything I need is in initramfs. /boot is still on EXT4 (and can stay there) but I just can't figure out how to mount my new ZFS root filesystem at boot!

I get the impression that this might be easier on CentOS 7, but for many reasons (politcal & technical) I really want to keep this on CentOS 6 for now.
 
Old 09-06-2015, 08:33 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
You will have to build ZFS into the kernel - as / you won't be able to use fuse to mount it I'd reckon.
Have a look in the "Linux from Scratch" section - ReaperX7 was looking to build lfs using ZFS root a while back.
 
Old 09-07-2015, 09:30 AM   #3
grahamh68
LQ Newbie
 
Registered: Jan 2010
Location: UK
Distribution: Fedora & CentOS
Posts: 8

Original Poster
Rep: Reputation: 1
Hi syg00, thanks for your reply. I don't think I'm using FUSE as the ZFS modules are built using DKMS from the ZFS on Linux RPMs. I think I'm missing something in initramfs or grub?
 
Old 09-07-2015, 04:34 PM   #4
grahamh68
LQ Newbie
 
Registered: Jan 2010
Location: UK
Distribution: Fedora & CentOS
Posts: 8

Original Poster
Rep: Reputation: 1
Looks like I've cracked it, albeit on CentOS 7.

I was missing the zfs-dracut package. Once I had that I just copied the running system over to my ZFS dataset (mount at /sysroot) and then chroot'd in to it to create the new initramfs. Then I edited the grub config kernel line to add root=ZFS=pool/dataset and Bob's your uncle!

Next thing to do is to see if I can translate this to CentOS 6 with the XEN 3.18 kernel...
 
1 members found this post helpful.
Old 09-07-2015, 06:38 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Thanks for the update.
I have a CentOS 7 system about to become a victim of a full system catastrophe and "bare metal" restore test. After the restore I may toss ZFS at it as well - haven't looked at ZFS since OpenSolaris was killed off. Never bothered on Linux - I have been an btrfs advocate since then.
 
Old 09-07-2015, 07:25 PM   #6
grahamh68
LQ Newbie
 
Registered: Jan 2010
Location: UK
Distribution: Fedora & CentOS
Posts: 8

Original Poster
Rep: Reputation: 1
Hey no worries. I've been running ZFS on Linux on a couple of systems for 2 or 3 years now and it's been rock solid (touch wood) and I just love the way you can pool all your storage and dice it up as you like.

I've been waiting for BTRFS to catch up with ZFS but I've come to realise that there are architectural differences that just make ZFS better and so I'd much rather see ZFS become more tightly integrated with Linux as a whole.

I might even try to get /boot on ZFS next but I know this will mean messing with grub and it might be more work than I have time for right now, but at least I can get root on ZFS which was my main aim at this time.

Good luck with your rebuild!

Graham.
 
Old 09-09-2015, 04:07 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Have you guys seen http://zfsonlinux.org/
Quote:
The native Linux kernel port of the ZFS filesystem. To get started with ZFS on Linux simply download the latest release and install using the directions for your distribution.
 
Old 09-09-2015, 04:12 AM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Yep - lot of difference between using ZFS as a standard (data) mount than using it as root though, which is the issue under consideration here.
 
Old 09-09-2015, 10:26 PM   #9
ChibaPet
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Rep: Reputation: Disabled
graham68, any luck on CentOS 6? I'd like to give it a try (with an elrepo-ml kernel for hardware support) and I'd love to know if you had any luck.
 
Old 02-01-2016, 09:30 AM   #10
grahamh68
LQ Newbie
 
Registered: Jan 2010
Location: UK
Distribution: Fedora & CentOS
Posts: 8

Original Poster
Rep: Reputation: 1
ChibaPet, sorry it's been a while since you asked your question! I gave up with CentOS 6 in the end and have moved to CentOS 7, and found a new "challenge". I got to the point of having ROOT on ZFS without too many problems and then decided I needed it all encrypted but since ZFS on Linux doesn't yet natively support encryption then the only sensible (other opinions noted) way to do that is to put ZFS on top of LUKS.

So I took it a step at a time and experimented with creating ROOT on LUKS, never having used LUKS before, and that all worked nicely. Next I tried building ZFS on top of LUKS and that all worked great too, but the last bit I can't crack is ROOT on ZFS on LUKS, as grub is looking for ROOT on a ZFS filesystem and doesn't seem to realise that it needs to luksOpen the drives first!

I have found a way to get grub to luksOpen devices before attempting to find ROOT but since my ZFS Pool comprises 10 devices I want to use a KeyFile rather than having to type in a long and complicated password 10 times, but the grub command to luksOpen devices doesn't support KeyFiles!!! Arggggg!!! (It's been frustrating!)

Last edited by grahamh68; 02-01-2016 at 12:06 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] RHEL 7, ZFS, extending filesystem planetf1 Red Hat 2 09-19-2014 09:44 PM
[SOLVED] Problem installing Arch system on a ZFS root: "ZFS: Cannot find bootfs." on boot. tajjada Linux - Software 4 12-25-2013 02:07 AM
Installing CentOS w/ root filesystem in disk image. crosstalk Linux - Distributions 1 11-30-2012 02:28 PM
creating zfs filesystem jmral23 Solaris / OpenSolaris 2 01-08-2007 02:35 PM
ZFS Root / Boot into ZFS from a usb flash drive Kataku Solaris / OpenSolaris 1 07-15-2006 04:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 10:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration