Create symlinks for mapper and volume group dir
This commit is contained in:
parent
da068ed9ce
commit
0e29099e60
|
@ -146,5 +146,25 @@ done
|
|||
### Fix group of LV
|
||||
chgrp disk -- /target/dev/dm-*
|
||||
## }}}
|
||||
## Create symlinks to LV
|
||||
### Get the list of all LV
|
||||
tmp_list_lv="/tmp/lv.rescue.list"
|
||||
find /dev/"${vgname}" -maxdepth 1 -type l -printf "%f\\n" > "${tmp_list_lv}"
|
||||
|
||||
### Create Volume Group and mapper directories
|
||||
mkdir -p -- /target/dev/"${vgname}"
|
||||
mkdir -p -- /target/dev/mapper
|
||||
|
||||
### For each LV
|
||||
while IFS= read -r LV_NAME
|
||||
do
|
||||
|
||||
#### Create symlink in Volume Group directory on the target system (eg. /dev/mapper/ovhsys/home -> ../dm-0)
|
||||
[ -L /target/dev/"${vgname}/${LV_NAME}" ] || ln -fs -- $(readlink /dev/"${vgname}/${LV_NAME}") /target/dev/"${vgname}/${LV_NAME}"
|
||||
|
||||
#### Create symlink in mapper directory on the target system (eg. /dev/mapper/mapper/ovhsys-home -> ../dm-0)
|
||||
[ -L /target/dev/mapper/"${vgname}-${LV_NAME}" ] || ln -fs -- $(readlink /dev/"${vgname}/${LV_NAME}") /target/dev/mapper/"${vgname}-${LV_NAME}"
|
||||
done < "${tmp_list_lv}"
|
||||
rm -f -- "${tmp_list_lv}"
|
||||
|
||||
# }}}
|
||||
|
|
Loading…
Reference in New Issue