So, I
wanted to demonstrate the commands in the previous post used for
resizing my file system, but of course I did that from a live USB (since
I wanted my file systems unmounted). However, I did not want to reboot
my computer just now to copy root's bash history, so I looked up how to
mount the overlay using these instructions:
https://fedoraproject.org/wiki/LiveOS_image
The simplified version would be:
- insert USB key into computer
- identify it
$ journalctl --system
mine was created as /dev/sdc1 - mount it, creating target directories as you go:
# mount /dev/sdc1 /tmp/sdc1 - mount the read-only squashed file system:
# mount /tmp/sdc1/LiveOS/squashfs.img /tmp/squashfs - create a block device for its ext3fs image:
# losetup /dev/loop1 /tmp/squashfs/LiveOS/ext3fs.img -r - create a block device for the overlay:
# losetup /dev/loop2 /tmp/sdc1/LiveOS/overlay-LIVE-foo - calculate size of loop1
# blockdev -q --getsz /dev/loop1mine was 12582912 - define a device combining the two
# dmsetup create myliveos --table "0 12582912 snapshot 7:1 7:2 P 8"
myliveos: my own name for the device, call it what you will
12582912: the # of blocks I acquired from step 7, put in yours
7:1 references loop1
7:2 references loop2 - mount the combined device
# mount /dev/mapper/myliveos /tmp/myliveos
Now I can cd into /tmp/myliveos, and get my .bash_history!
Keine Kommentare:
Kommentar veröffentlichen