From da068ed9ce1f8c9c692b0fb460db4009d831babf Mon Sep 17 00:00:00 2001 From: Gardouille Date: Wed, 3 Apr 2019 14:08:28 +0200 Subject: [PATCH] Create LV inodes on the target system --- debian/chroot.install | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/debian/chroot.install b/debian/chroot.install index fdad55d..2c05c7e 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -132,5 +132,19 @@ done ### Fix group of disk/partitions chgrp disk -- /target"${hdd}"* ## }}} +## Create LV inodes {{{ +### Count the number of LV on the rescue system +nb_lv=$(ls -l -- /dev/dm-* | wc -l) +lv=0 +### Start at 0 and less than $nb_lv cause it start at 0 +while [ "${lv}" -lt "${nb_lv}" ]; do + #### Create the LV on the target system + [ -b /target/dev/dm-"${lv}" ] || mknod --mode=660 /target/dev/dm-"${lv}" b 252 "${lv}" + (( lv++ )) +done + +### Fix group of LV +chgrp disk -- /target/dev/dm-* +## }}} # }}}