我正在尝试在 loop0 设备上创建加密驱动器。对于此命令
/sbin/cryptsetup create cryptedDrive /dev/loop0
我收到以下错误
无法读取设备 /dev/loop0
这是 loop3 设备的 strace 输出:
(为了更好的粘贴->粘贴箱)
munmap(0xb7845000, 4096) = 0
mlockall(MCL_CURRENT|MCL_FUTURE) = 0
getpriority(PRIO_PROCESS, 0) = 20
setpriority(PRIO_PROCESS, 0, -18) = 0
stat64("/dev/loop3", {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 3), ...}) = 0
open("/dev/loop3", O_RDONLY|O_SYNC|O_DIRECT|O_LARGEFILE) = 3
ioctl(3, BLKSSZGET, 0xbff2ad84) = 0
fstatfs64(3, 84, {f_type=0x1021994, f_bsize=4096, f_blocks=46077, f_bfree=46033, f_bavail=46033, f_files=46077, f_ffree=45421, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
fstat64(3, {st_mode=S_IFBLK|0660, st_rdev=makedev(7, 3), ...}) = 0
open("/proc/mounts", O_RDONLY) = 4
fstat64(4, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7845000
read(4, "rootfs / rootfs rw 0 0\nnone /sys"..., 1024) = 873
stat64("/dev/shm", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=40, ...}) = 0
stat64("/var/run", {st_mode=S_IFDIR|0755, st_size=460, ...}) = 0
stat64("/var/lock", {st_mode=S_IFDIR|S_ISVTX|0777, st_size=60, ...}) = 0
stat64("/lib/init/rw", {st_mode=S_IFDIR|0755, st_size=60, ...}) = 0
read(4, "", 1024) = 0
_llseek(4, 0, [0], SEEK_SET) = 0
read(4, "rootfs / rootfs rw 0 0\nnone /sys"..., 1024) = 873
stat64("/", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat64("/sys", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
stat64("/proc", {st_mode=S_IFDIR|0555, st_size=0, ...}) = 0
stat64("/dev", {st_mode=S_IFDIR|0755, st_size=3540, ...}) = 0
close(4) = 0
munmap(0xb7845000, 4096) = 0
read(3, "", 512) = 0
write(2, "Cannot read device /dev/loop3.\n", 31Cannot read device /dev/loop3.
) = 31
close(3) = 0
munlockall() = 0
setpriority(PRIO_PROCESS, 0, 0) = 0
exit_group(-22) = ?
(为了更好的粘贴->粘贴箱)
答案1
缺少输出losetup -a
,并且losetup -f
给出第一个空闲设备为/dev/loop0
,表明您尚未将该环回设备与任何物理存储关联。您希望使用哪个未使用的物理分区或 LVM 卷作为环回加密设备的实际存储?
如果是,/dev/sd2a
则使用 将其绑定到环回设备losetup /dev/loop0 /dev/sd2a
,然后重试cryptsetup
。