HOW to install software to mapped device persistently
Hi
All we know the good way to make read-only ROOT device be read-write looking. It is the use of dmsetup in initrd. It works perfect. But ..
Question1: HOW to install software to this mapped device persistently ?
For example, if you need to upgrade something and ROOT device is read-write in fact (e.g. flash) but used as read-only for safety.
I tried to do this by sequence of commands:
(/dev/hdc1 "snapshotted" to / by devmapper)
# mount /dev/hdc1 /mnt/disk # chroot /mnt/disk # rpm -Uv <pkg> or whateveer else # exit # umount /mnt/disk Of course, my changes were not seen from "/" because mapper know nothing about that changes. So, I need to reboot the system to make changes visible. Another and more clear way is to reboot to standard configuration (without device mapper)and install/update software, then reboot again to devmapper configuration. Both these ways are inacceptible in production system.
Question2: How to make devmapper to know that base (snapshot'ed) device have been changed ?
1( My thoughs was to remap root from snapshot to disk, upgrade software and remap root back to snapshot. It doesn't work.
2( We may delete snapshot and snapshot-orig and disk mappings, then upgrade soft, then restore snapshotting back. It doen't work also.
The case, I think, in initrd nature of mapping. I.e. mapping devices are in /inird/dev/mapper instead of /dev/mapper.
My device-mapper configuration as following (by initrd)
--
root-orig: 0 430048 snapshot-origin 254:000
ram: 0 430048 linear 007:000 0
root: 0 430048 snapshot 254:000 254:001 P 8
hd: 0 430048 linear 022:001 0
--
"hd" - base device (compact flash in my case, /dev/hdc1) "ram" - temporary loop device on file in ramfs.
"root" - snapshot of "hd" to "ram"
"root-orig" - snapshot-orig to "hd"
Rootfs mounted on /dev/mapper/root.
Question3stupid: Where rootfs must be mounted - on /dev/mapper/root or /dev/mapper/root-orig ?
Signature · 2 lines
regards, Vladimir
Alasdair G Kergon
maintainerQuoted 3 lines · V.Kukushkin
All we know the good way to make read-only ROOT device be read-write looking.
It is the use of dmsetup in initrd. It works perfect. But ..
Depends where the 'read-only' setting is coming from.
LVM? Use lvchange -pr
dm itself? (using device vg0-lvol0 as the example)
'dmsetup info vg0-lvol0 | grep State' shows ACTIVE (READ-ONLY)
Then:
dmsetup table vg0-lvol0 | dmsetup reload vg0-lvol0; dmsetup resume vg0-lvol0
And to put it back read-only afterwards
dmsetup table vg0-lvol0 | dmsetup reload -r vg0-lvol0; dmsetup resume vg0-lvol0
Alasdair
Signature · 1 line
[email protected]