Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] root on zfs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Sat Jun 28, 2014 5:43 pm    Post subject: [SOLVED] root on zfs Reply with quote

I've created a disk partition and set up a zpool and a zfs dataset. zfs is in the boot runlevel. however at boot while the pool is online I have to manually mount the dataset.

rc.log shows:

Code:

mounting zfs filesystems

and then immediately
Code:

exporting zfs filesystems


Is this the way the initscript was written to work?


Last edited by mrbassie on Mon Jul 14, 2014 7:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Sat Jun 28, 2014 8:20 pm    Post subject: Re: zfs question Reply with quote

mrbassie wrote:
I've created a disk partition and set up a zpool and a zfs dataset. zfs is in the boot runlevel. however at boot while the pool is online I have to manually mount the dataset.

rc.log shows:

Code:

mounting zfs filesystems

and then immediately
Code:

exporting zfs filesystems


Is this the way the initscript was written to work?

please read this http://docs.oracle.com/cd/E19253-01/819-5461/gaztn/index.html
and figure if you have correctly mounted your / fs
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Sat Jun 28, 2014 9:01 pm    Post subject: Reply with quote

thanks for the link, but I don't see what I've done wrong.

I had /home on a primary partition, that's what the zpool now is.

so I did:

umount /home

rm -rf /home

mkdir /mnt/zfs

zpool create -f zfspool -m /mnt/zfs /dev/disk/by-id/foobar-part3

zfs create zfspool/home

zfs set mountpoint=/home zfspool/home

rc-update add zfs boot

init 6

:?

EDIT: I do not use an initramfs, not sure if that's relevant.
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Sun Jun 29, 2014 8:50 am    Post subject: Reply with quote

i have zfs on / but with home only it should be even easier.

you did: zfs set mountpoint=/home zfspool/home

could you please check before manualy mounting if the mountpoint is really set?: zfs get mountpoint zfspool/home
----
also: zpool status
and: zfs list

would be interesting.
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Sun Jun 29, 2014 9:15 am    Post subject: Reply with quote

yes the mountpoint is set

zpool status returns:
Code:

pool: zfspool
state: ONLINE
scan: none requested
config:

              NAME                           STATE          READ  WRITE  CKSUM
              ata-foobar-part3          ONLINE                0          0            0

errors: No known data errors


zfs list returns:

Code:

NAME                 USED    AVAIL    REFER  MOUNTPOINT
zfspool              1.42M    57.1G       272K  /mnt/zfs
zfspool/home     272K     57.1G       272K  /home
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Sun Jun 29, 2014 11:03 am    Post subject: Reply with quote

seems fine for me.
how is your /etc/fstab? you should not have any /home mount defined.
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Sun Jun 29, 2014 11:09 am    Post subject: Reply with quote

I deleted the fstab entry for the /home partition at the start. at boot /home is not mounted at all.
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Sun Jun 29, 2014 11:12 am    Post subject: Reply with quote

mrbassie wrote:
I deleted the fstab entry for the /home partition at the start. at boot /home is not mounted at all.

i am not sure what do you mean by "at boot". if you are not using zfs in initramfs zfs will start to work later in the boot process.
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Sun Jun 29, 2014 11:24 am    Post subject: Reply with quote

I mean when I boot the system /home is not mounted.

Ok I'll try building an initramfs and report back.


Last edited by mrbassie on Sun Jun 29, 2014 12:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Sun Jun 29, 2014 12:04 pm    Post subject: Reply with quote

ok, I rebuilt the kernel with genkernel all, rebooted the new one with the initramfs and recompiled zfs and all the dependencies and rebooted again.

now the zpool is not brought online and I have to use the -f flag to import it. kernel log reports the zfs module is loaded, rc.log is reports the same as in my original post.

:?
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Sun Jun 29, 2014 6:08 pm    Post subject: Reply with quote

mrbassie wrote:
ok, I rebuilt the kernel with genkernel all, rebooted the new one with the initramfs and recompiled zfs and all the dependencies and rebooted again.

now the zpool is not brought online and I have to use the -f flag to import it. kernel log reports the zfs module is loaded, rc.log is reports the same as in my original post.

:?


ok now i have two aproaches:

1. you could revise your steps with this manual? http://www.funtoo.org/ZFS_Install_Guide
i did setup zfs on / fs with this. i also tried to use the arch manual which was somewhat helpful. and also gentoo zfs manual which sucks almost completely.

2. the -f flag reminds me of my issue with the pools i had after my 1st experimnents with zfs on my machine. unfortunately my history is gone and my memory the same. i can only post you this forum article: https://forums.gentoo.org/viewtopic-t-975854-start-0.html
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Mon Jun 30, 2014 5:08 pm    Post subject: Reply with quote

I've been following the Funtoo guide at work today and built a / on zfs question, haven't got it to boot yet as /boot/grub/menu/lst is broken, I only figured that one out once I got home.

On my home machine I've just run genkernel --zfs initramfs which I hope will get it mounting but I'm also towards the end on and emerge -e world which has been going on for a few days ( thanks to emerge --resume :) )

I'll post when I've tested it. Thanks for the help so far.
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Tue Jul 01, 2014 10:48 am    Post subject: Reply with quote

well the /home on zfs machine is up and running with genkernel --zfs initramfs

I've also finished a base install root on zfs at work, can't get it to boot. I follwed that funtoo guide exactly, other than replacing the name funtoo with gentoo where appropriate. On the grub kernel line if I add root=ZFS=tank, the pool is imported and it then tells me that it can't find the root block device and that there is not a dataset named tank. root=ZFS=tank/gentoo/root does the same thing as does root=ZFS=tank/root. if I don't enter tank in the line it tells me there is no pool name x.
Any ideas?

EDIT: got it to work with setting DEV_RAM_BLK in the kernel

Thanks for all the help
Back to top
View user's profile Send private message
e3k
Guru
Guru


Joined: 01 Oct 2007
Posts: 513
Location: Inner Space

PostPosted: Tue Jul 01, 2014 1:59 pm    Post subject: Reply with quote

mrbassie wrote:
well the /home on zfs machine is up and running with genkernel --zfs initramfs

I've also finished a base install root on zfs at work, can't get it to boot. I follwed that funtoo guide exactly, other than replacing the name funtoo with gentoo where appropriate. On the grub kernel line if I add root=ZFS=tank, the pool is imported and it then tells me that it can't find the root block device and that there is not a dataset named tank. root=ZFS=tank/gentoo/root does the same thing as does root=ZFS=tank/root. if I don't enter tank in the line it tells me there is no pool name x.
Any ideas?

EDIT: got it to work with setting DEV_RAM_BLK in the kernel

Thanks for all the help

great :)
_________________

Flux & Contemplation - Portrait of an Artist in Isolation

Back to top
View user's profile Send private message
chaseguard
Tux's lil' helper
Tux's lil' helper


Joined: 25 Jun 2004
Posts: 140

PostPosted: Thu Jul 03, 2014 5:14 am    Post subject: Reply with quote

This is what my rc log looks like (booting up):


* Starting ZFS ...
* Checking if zfs userspace tools present
* Importing ZFS pools
* Mounting ZFS filesystems
* Exporting ZFS filesystems
[ ok ]


I am not sure what it all means, but everything is mounted where it should be. I am not sure what exporting filesystem means, but it is not the same as exporting a pool. If things are mounted where you want all is good. Unless you set the ZFS dataset mountpoint to "legacy" (vice a real mountpoint) then remove the relevant fstab lines. Also, I think "zfs list" shows all the datasets without regard to their mount status. So, best to use plain old "mount" to see what is really hooked up. ZFS is impressive. It is almost annoying because it leaves so little to fuss about.
Back to top
View user's profile Send private message
ryao
Retired Dev
Retired Dev


Joined: 27 Feb 2012
Posts: 132

PostPosted: Thu Jul 10, 2014 9:49 am    Post subject: Reply with quote

The exporting message refers to NFS exports and samba shares. If you have none, then it is a no-op.

As for / on ZFS, I maintain notes on how to do this:

https://github.com/ryao/zfs-overlay/blob/master/zfs-install
Back to top
View user's profile Send private message
mrbassie
l33t
l33t


Joined: 31 May 2013
Posts: 771
Location: over here

PostPosted: Mon Jul 14, 2014 7:11 pm    Post subject: Reply with quote

Thanks for sharing ryao (and for the explanation). I've copied it locally for future reference. I actually just moved my home machine to / on zfs this afternoon with a stage4, I hadn't looked at the thread in the meantime and hadn't seen your post. Wish I had. I did it successfully yesterday on a spare hdd. Wanted to do a dry run before I commited my ssd. It took me several tries.

I should have marked this as solved already, I'm also going to further rename it to make it easier to search for for anyone else having the same or similar trouble.

EDIT: Oops! I really should thank you for all your hard work on the project too. Very much appreciated. I'm very sorry I didn't realise at first you were personally involved in the project. :oops:

Also It's fantastic that devs in the Gentoo community take the time to come on the public forums to advise and help end users. Many thanks to you all.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2280
Location: Adendorf, Germany

PostPosted: Tue Jul 15, 2014 9:50 am    Post subject: Reply with quote

ryao wrote:
The exporting message refers to NFS exports and samba shares. If you have none, then it is a no-op.

As for / on ZFS, I maintain notes on how to do this:

https://github.com/ryao/zfs-overlay/blob/master/zfs-install
That's cool!

Maybe we should have a ZFS root install in the wiki like Funtoo has? I used it for my gentoo laptop and it worked with only little adaption.
_________________
Important German:
  1. "Aha" - German reaction to pretend that you are really interested while giving no f*ck.
  2. "Tja" - German reaction to the apocalypse, nuclear war, an alien invasion or no bread in the house.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum