Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Jan 2013 16:32:19 +0100
From:      "Ronald Klop" <ronald-freebsd8@klop.yi.org>
To:        freebsd-stable@freebsd.org
Subject:   Re: Deleting the top-level ZFS file system (without affecting its children)
Message-ID:  <op.wqq6r5vi8527sy@ronaldradial.home>
In-Reply-To: <BABF8C57A778F04791343E5601659908236D44@cinip100ntsbs.irtnog.net>
References:  <BABF8C57A778F04791343E5601659908236D44@cinip100ntsbs.irtnog.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 11 Jan 2013 16:11:32 +0100, xenophon\+freebsd  
<xenophon+freebsd@irtnog.org> wrote:

> When I originally set up ZFS on my server, I used the topmost file
> system for the root file system.  Last night, I used "zfs send" and "zfs
> recv" to create a new root file system named "zroot/root".  Then, I
> adjusted the mount points in single-user mode.  Based on my reading of
> the contents of src/sys/boot/zfs/ and src/sys/boot/i386/zfsboot/
> (specifically the zfs_mount() and zfs_get_root() functions in
> zfsimpl.c), I ran "zpool set bootfs=zroot/root zroot".  This should
> allow the boot program to find the new root file system.
>
> Now, I'd like to delete the old root file system and return its storage
> to the pool.  Clearly, "rm -rf /oldroot/*" wouldn't return the space
> already allocated to the old root file system, but I don't want to run
> "zfs destroy zroot", as that will probably affect its children (the
> whole rest of the pool).  At this point, I suspect that I'd have to
> re-create the pool to get the desired configuration.
>
> Is my understanding correct?
>
> Right now, the pool's datasets look something like the following:
>
>   xenophon@cinep001bsdgw:~>zfs list
>   NAME           USED  AVAIL  REFER  MOUNTPOINT
>   zroot         75.5G   143G  1.04G  /oldroot
>   zroot/root    1.04G   143G  1.03G  /
>   zroot/usr     28.6G   143G  10.2G  /usr
>   (etc.)
>
> Best wishes,
> Matthew
>

Why would rm -rf /oldroot/* not return all the allocated space?
I can only think of snapshots keeping the space allocated, but you can  
remove those too.
Can you elaborate on that?

Ronald.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?op.wqq6r5vi8527sy>