bsdinstall ZFS /root in wrong dataset

Allan Jude freebsd at allanjude.com
Tue Mar 25 17:11:38 UTC 2014


On 2014-03-25 11:31, dteske at FreeBSD.org wrote:
> 
> 
>> -----Original Message-----
>> From: Bryan Drewery [mailto:bdrewery at FreeBSD.org]
>> Sent: Saturday, March 22, 2014 8:03 AM
>> To: dteske at FreeBSD.org
>> Cc: sysinstall at FreeBSD.org
>> Subject: Re: bsdinstall ZFS /root in wrong dataset
>>
>> On 3/22/2014 9:55 AM, dteske at FreeBSD.org wrote:
>>>> -----Original Message-----
>>>> From: Bryan Drewery [mailto:bdrewery at FreeBSD.org]
>>>> Sent: Saturday, March 22, 2014 5:40 AM
>>>> To: sysinstall at FreeBSD.org
>>>> Subject: bsdinstall ZFS /root in wrong dataset
>>>>
>>>> (I am not subscribed so please CC me)
>>>>
>>>> The ZFS layout uses the zroot/ROOT/<BE> to support boot environments.
>>>> The problem with it is that /root is part of the BE. Home directories
>>>> are properly outside of the BE.
>>>>
>>>> /root should really be outside to persist history and other changes
>>>> to
>>> root's
>>>> homedir through BE changes/upgrades.
>>>>
>>>> This is quite noticeable if you create a new BE (beadm create; beadm
>>>> mount) and then installworld/kernel into it, then activate and reboot.
>>>> All of your history and /root changes are missing for the period
>>>> between creating the BE and rebooting.
>>>>
>>>> Something like this is needed:
>>>>
>>>>> --- usr.sbin/bsdinstall/scripts/zfsboot (revision 263620)
>>>>> +++ usr.sbin/bsdinstall/scripts/zfsboot (working copy)
>>>>> @@ -128,6 +128,8 @@
>>>>>
>>>>>         # Home directories separated so they are common to all BEs
>>>>>         /usr/home       # NB: /home is a symlink to /usr/home
>>>>> +       /root           mountpoint=/root
>>>>>
>>>>>         # Ports tree
>>>>>         /usr/ports              compression=lz4,setuid=off
>>>>
>>>>
>>>> Though, I am unsure on whether we should make a zroot/root dataset
>>>> and mount it in or mkdir /usr/home/root and symlink /root to it. The
>>>> symlink does cause mergemaster confusion though. I have no opinion on
>>>> where we create the root dataset, as long as it is outside of ROOT.
>>>>
>>>
>>> Hi bdrewery,
>>>
>>> Thanks for kicking off this thread (esp. on list).
>>>
>>> Placing /root in /usr/home/root would break in a few scenarios as you
>>> correctly identified. Let's give your patch a go and wait for some
>>> feedback before MFC'ing. I don't expect any fallout from your patch;
>>> looks great and indeed should solve the problem (if I understand
> correctly).
>>>
>>> Do you want to commit or should I?
>>>
>>
>> Sounds good. I'll commit in about an hour.
>>
> 
> Got a test result from the commit on -current...
> 
>> -----Original Message-----
>> From: Bruno Lauzé [mailto:brunolauze at msn.com]
>> Sent: Tuesday, March 25, 2014 7:29 AM
>> To: freebsd-current at freebsd.org
>> Subject: install error with r263638
>>
>> I am experiencing issue related to r263638.During a ZFS Install, it does
> create
>> a new volume for /root but bsdinstall cannot copy "root/.cshrc" during
>> base.txz extraction.Would we want to [add] ",canmount=off" or change the
>> way root profile gets created for zfs install?
>> What could be the cause?
> 
> Got so much other stuff to think about right now...
> But I think the user is saying that we broke it ;D
> 

there is another thing this breaks. The reason /root is in / instead of
being in /usr/home/root like every other user, is because /usr doesn't
get mounted in single user mode

/root needs to exist in the root data set, so that when you login in
single user mode, you have a home directory.


-- 
Allan Jude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 899 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-sysinstall/attachments/20140325/b0a3291c/attachment.sig>


More information about the freebsd-sysinstall mailing list