Hello, On Oct 18 10:22 Andreas Schwab wrote (excerpt):
On Okt 18 2016, Johannes Meixner <jsmeix@suse.de> wrote:
# find out what subvolume on what device node is mounted at '/': output=( $(findmnt -nrv -t btrfs -o TARGET,SOURCE,FSROOT | grep '^/ ' ) ) output=( $(findmnt -nrv -t btrfs -o TARGET,SOURCE,FSROOT /) )
Only a little bit better. Good: ----------------------------------------------------------------- # find out what subvolume on what device node is mounted at '/': output=( $(findmnt -nrv -t btrfs -o SOURCE,FSROOT / ) ) # SOURCE is the device node that is mounted at '/': device=${output[0]} # FSROOT is the subvolume that is mounted at '/': fsroot=${output[1]} ----------------------------------------------------------------- But I think optimization of my quick personal hack script is not the main goal here. I think best would be a /usr/sbin/mksubvolume tool that provides all needed functionality. Kind Regards Johannes Meixner -- SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Graham Norton - HRB 21284 (AG Nuernberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org