我已经使用命令备份了一个驱动器及其所有分区
dd if=/dev/sda of=/media/oshirowanen/external-drive/backups-2019/full_drive_backup.img
/dev/sda
是具有完全加密的 Linux 操作系统的 ssd。
在我擦除这个驱动器并重新使用它之前,我想确保备份已经工作。
我通过搜索 unix.stackexchange 和其他 stackexchange 站点尝试了以下操作:
sudo losetup -P /dev/loop0 /media/oshirowanen/external-drive/backups-2019/full_drive_backup.img
[sudo] password for oshirowanen: [password goes here]
losetup: /media/oshirowanen/external-drive/backups-2019/full_drive_backup.img: failed to set up loop device: Device or resource busy
sudo losetup -P /dev/loop100 /media/oshirowanen/external-drive/backups-2019/full_drive_backup.img
sudo cryptsetup luksOpen /dev/loop100p5 img5
Enter passphrase for /dev/loop100p5: [password goes here]
cd /mnt
mkdir img5
sudo mount /dev/mapper/img5 img5
mount: /mnt/img5: unknown filesystem type 'LVM2_member'.
我究竟做错了什么?两者cryptsetup
和lvm2
都已安装。
如果这不是备份驱动器的最佳方法,请建议其他更好的方法。
更新 1:
下面是 /dev/sda 的分区截图:
更新 2:
LiveUSB 的输出:
liveusb@liveusb:~$ sudo losetup -P /dev/loop100 /media/external-drive/backups-2019/full_drive_backup.img
liveusb@liveusb:~$ sudo cryptsetup luksOpen /dev/loop100p5 img5
Enter passphrase for /dev/loop100p5:
liveusb@liveusb:~$ cd /mnt
liveusb@liveusb:/mnt$ sudo mkdir img5
liveusb@liveusb:/mnt$ sudo mount /dev/mapper/img5 img5
mount: /mnt/img5: unknown filesystem type 'LVM2_member'.
liveusb@liveusb:/mnt$ sudo pvscan
PV /dev/mapper/img5 VG ubuntu-vg lvm2 [232.16 GiB / 0 free]
Total: 1 [232.16 GiB] / in use: 1 [232.16 GiB] / in no VG: 0 [0 ]
liveusb@liveusb:/mnt$ sudo vgscan
Reading volume groups from cache.
Found volume group "ubuntu-vg" using metadata type lvm2
liveusb@liveusb:/mnt$ sudo vgs
VG #PV #LV #SN Attr VSize VFree
ubuntu-vg 1 2 0 wz--n- 232.16g 0
liveusb@liveusb:/mnt$ sudo lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
root ubuntu-vg -wi-a----- <231.21g
swap_1 ubuntu-vg -wi-a----- 980.00m
liveusb@liveusb:/mnt$ ls /dev/mapper/
control img5 ubuntu--vg-root ubuntu--vg-swap_1
liveusb@liveusb:/mnt$