New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FS#1215 - /sbin/block
is not able to mount logical volumes over the /overlay
directory.
#7971
Comments
mkresin: Nope, doesn't work this way. Please add all required informations and the steps to reproduce the issue to this ticket. If you want to get a bug fixed, make it as easy as possible to reproduce the issue. Forcing someone to extract all the required informations from a forum thread isn't what I would call easy. |
tabad: Hello Mathias, Yes, you are right but as I wrote the topic like it was a bug report I thought it was a valid start point; I apologize. Well, I'm going to include here all the information and the steps to reproduce the error. ==== Hardware & LEDE Firmware ====
==== How to reproduce the bug ====
root@LEDE:~# opkg -V0 update
root@LEDE:~# opkg -V0 install kmod-usb-storage usbutils
root@LEDE:~# opkg -V0 install block-mount
root@LEDE:~# opkg -V0 install gdisk
root@LEDE:~# opkg -V0 install lvm2
root@LEDE:~# opkg -V0 install f2fs-tools kmod-fs-f2fs
root@LEDE:~# opkg -V0 install swap-utils
root@LEDE:~# gdisk /dev/sda
Command (? for help): x
Expert command (? for help): z
Blank out MBR? (Y/N): Y
root@LEDE:~# mkswap -L swap /dev/sandisk/swap
root@LEDE:~# mkfs.f2fs -q -l cifs /dev/sandisk/cifs
root@LEDE:~# mkfs.f2fs -q -l overlay /dev/sandisk/overlay
root@LEDE:~# block detect > /etc/config/fstab
root@LEDE:~# uci show fstab
fstab.@global[0]=global
fstab.@global[0].anon_swap='0'
fstab.@global[0].anon_mount='0'
fstab.@global[0].auto_swap='1'
fstab.@global[0].auto_mount='1'
fstab.@global[0].delay_root='5'
fstab.@global[0].check_fs='0'
fstab.@mount[0]=mount
fstab.@mount[0].target='/mnt/sda1'
fstab.@mount[0].uuid='yqu58H-4vkv-9diC-scUc-skXn-UbDp-S1x8zf'
fstab.@mount[0].enabled='0'
fstab.@mount[1]=mount
fstab.@mount[1].target='/mnt/sandisk-cifs'
fstab.@mount[1].uuid='d3121a1b-0afb-4519-aab3-6f524fc143d7'
fstab.@mount[1].enabled='0'
fstab.@mount[2]=mount
fstab.@mount[2].target='/mnt/sandisk-overlay'
fstab.@mount[2].uuid='5a5c2088-d3ef-4a1b-9f31-2dc814b1097c'
fstab.@mount[2].enabled='0'
fstab.@swap[0]=swap
fstab.@swap[0].uuid='54b4f904-3f8d-42df-bf0e-714e807c2320'
fstab.@swap[0].enabled='0'
root@LEDE:~# mount /dev/mapper/sandisk-overlay /mnt/sandisk-overlay/
root@LEDE:~# tar -C /overlay -cf - . | tar -C /mnt/sandisk-overlay -xf -
root@LEDE:~# umount /dev/mapper/sandisk-overlay
root@LEDE:~# reboot
==== The proof ==== Once the router has rebooted:
root@LEDE:~# df -hP | grep '/dev/mapper'
/dev/mapper/sandisk-cifs 2.0G 188.0M 1.8G 9% /mnt/sandisk-cifs
root@LEDE:~# block mount
block: /dev/mtdblock2 is already mounted on /rom
block: /dev/mtdblock3 is already mounted on /overlay
block: /dev/mapper/sandisk-cifs is already mounted on /mnt/sandisk-cifs
It seems like ///dev/mapper/sandisk-overlay// doesn't exsist. But whether ///dev/mapper/sandisk-overlay// is mounted over whatever other directory, it works perfectly.
root@LEDE:~# uci set fstab.@mount[1].target='/mnt/sandisk-overlay'
root@LEDE:~# uci commit fstab
And this last configuration works even when the system is rebooted. Best regards, |
hroo: If I understood correctly, the problem is that an lvm partition cannot be mounted as /overlay at boot time. I had the same problem and googling for a solution I stumbled over Tomas forum entry. In /lib/preinit I created a file 80_lvm2 with content:
where the statements between {} are copied from /etc/init.d/lvm2 Since 80_lvm2 alphabetically goes before 80_mount_root it should be executed before the root partition is mounted if I interpreted the preinit scripts correctly. After setting the overlay parameters I rebooted and had the desired overlay mount. For me this solved my problem quite simple and easy. Maybe a good solution is to have the lvm package create this script in the /lib/preinit directory so that it is automatically activated. Hope this helps someone. |
yousong: @hroo , thanks for the efforts. Better just open a pull request at https://github.com/openwrt/packages/pulls and ping Daniel Golle the maintainer there. |
tabad:
Some days ago I wrote the topic //[[https://forum.lede-project.org/t/how-to-use-lvm-for-extend-the-root-filesystem/9166|How to use LVM for extend the root filesystem]]// into //[[https://forum.lede-project.org/c/general|Installing and Using LEDE]]// category of LEDE Forum trying to do exactly that but when the system tryies to mount the logical volume destinated to
/overlay
on boot time, the commandblock mount
fails.Everything information about the bug and the way to reproduce it is wrote in //[[https://forum.lede-project.org/t/how-to-use-lvm-for-extend-the-root-filesystem/9166|How to use LVM for extend the root filesystem]]//.
Thanks in advance,
The text was updated successfully, but these errors were encountered: