我正在尝试在我的loop0设备上创建一个加密的驱动器.对于此命令
/sbin/cryptsetup create cryptedDrive /dev/loop0
我收到以下错误
Cannot read device /dev/loop0
这是我的loop3设备的strace输出:
(更好的粘贴 – > pastebin)
munmap(0xb7845000,4096) = 0 mlockall(MCL_CURRENT|MCL_FUTURE) = 0 getpriority(PRIO_PROCESS,0) = 20 setpriority(PRIO_PROCESS,-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,...}) = 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_size=60,...}) = 0 stat64("/lib/init/rw",...}) = 0 read(4,"",1024) = 0 _llseek(4,[0],SEEK_SET) = 0 read(4,1024) = 873 stat64("/",st_size=4096,...}) = 0 stat64("/sys",...}) = 0 stat64("/proc",{st_mode=S_IFDIR|0555,...}) = 0 stat64("/dev",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 exit_group(-22) = ?
(更好的粘贴 – > pastebin)
解决方法
losetup -a缺少输出,而losetup -f为您提供第一个免费设备/ dev / loop0,这表明您还没有将该环回设备与任何物理存储相关联.您希望将未使用的物理分区或LVM卷用作环回加密设备的实际存储?
如果是/ dev / sd2a,则使用losetup / dev / loop0 / dev / sd2a将其绑定到环回设备,然后再次尝试cryptsetup.