On Wed, Aug 30, 2017 at 10:24:50AM -0700, Yingyi Luo wrote: > From: yingyil <ying...@google.com> > > Add -S/--subvol [NAME] option to configure. It enables users to create a > subvolume under the toplevel volume and populate the created subvolume > with files from the rootdir specified by -r/--rootdir option.
Sounds good, I think we can achieve more than just subvol + copy of a directory, with a extension of the command line ui. This should allow to create multiple subvolumes, nested (or not) with contents of the directory copied over any pre-created contents from --rootdir. First, the option --subvol could be specified repeatedly. Each path component that would not exist will become a directory, the last one will be subvolume. With --rootdir among the --subvol options, all existing paths would be reused (as long files and directories/subvolumes don't clash). Example, immitating one of used root filesystem layout: expected result / /@ (subvolume /@/boot (subvolume) /@/home (subvolume) /@/var/log (subvolume) /@/tmp (subvolume) and over that, same as if some tarball is unpacked, creating /bin, /etc, /usr, /sbin etc. would be generated by by something like: $ mkfs.btrfs -S /@ -S /@/boot -S /@/home -S /@/var/log -S /@/tmp --rootdir rootfiles/ /path/to/device Reusing --rootdir might be a bad idea, so we'd have add a new option that would specify the target path and the source directory. Your patchset is a good start and I'm not asking you to implement the above, but to let you know that the end result might be more general compared to the usecase that brought you here. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html