我曾经dd备份过一个80GB 的驱动器
dd if=/dev/sdb of=~/sdb.img
Run Code Online (Sandbox Code Playgroud)
现在我需要访问该驱动器上的一些文件,但我不想将“.img”复制回驱动器。
mount ~/sdb.img /mnt/sdb也不起作用。它返回:
mount: you must specify the filesystem type
Run Code Online (Sandbox Code Playgroud)
我试图找到文件系统类型 file -s
fox@shoebox $ file -s sdb.img
sdb.img: x86 boot sector; partition 1: ID=0x12, starthead 1, startsector 63, 10233342 sectors; partition 2: ID=0xc, active, starthead 0, startsector 10233405, 72517410 sectors; partition 3: ID=0xc, starthead 0, startsector 82750815, 73545570 sectors, code offset 0xc0
Run Code Online (Sandbox Code Playgroud)
是否可以安装sdb.img,或者我必须使用它dd来恢复驱动器?
这周我在搞 PowerShell,发现你需要对你的脚本进行签名才能运行它们。Linux 中是否有任何与阻止 bash 脚本运行相关的类似安全功能?
我所知道的与此类似的唯一功能是需要特定密钥的 SSH。
当我运行时mount,我可以看到我的硬盘安装为fuseblk.
/dev/sdb1 on /media/ecarroll/hd type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096,uhelper=udisks2)
Run Code Online (Sandbox Code Playgroud)
但是,fuseblk并没有告诉我设备上的文件系统是什么。我发现它正在使用,gparted但我想知道如何使用命令行实用程序找到 fs。
从这篇文章可以看出这FS:[0x28]是一个堆栈金丝雀。我在这个函数上使用 GCC 生成相同的代码,
void foo () {
char a[500] = {};
printf("%s", a);
}
Run Code Online (Sandbox Code Playgroud)
具体来说,我得到这个程序集..
0x000006b5 64488b042528. mov rax, qword fs:[0x28] ; [0x28:8]=0x1978 ; '(' ; "x\x19"
0x000006be 488945f8 mov qword [local_8h], rax
...stuff...
0x00000700 488b45f8 mov rax, qword [local_8h]
0x00000704 644833042528. xor rax, qword fs:[0x28]
0x0000070d 7405 je 0x714
0x0000070f e85cfeffff call sym.imp.__stack_chk_fail ; void __stack_chk_fail(void)
; CODE XREF from 0x0000070d (sym.foo)
0x00000714 c9 leave
0x00000715 c3 ret
Run Code Online (Sandbox Code Playgroud)
什么是设置值fs:[0x28]?内核,还是 GCC 投入了代码?你能在内核中显示代码,或者编译成设置的二进制文件fs:[0x28]吗?金丝雀是在启动时重新生成的,还是在进程生成时重新生成的?这是在哪里记录的?
这两个选项有什么区别 /boot/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
Run Code Online (Sandbox Code Playgroud) 我在将 Debian Jessie 中的 Logitech K810 蓝牙键盘与 BlueZ 版本 5.23-1、内核 3.16.0-4 连接时遇到问题。
键盘大部分时间都可以正常工作,但有时它根本不起作用,并bluetoothctl给我一个控制器不可用的错误。
发生这种情况时,hciconfig 仍然可以识别设备,我得到以下输出:
# hciconfig hci0 up
# hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 40:2C:F4:68:02:CA ACL MTU: 1021:8 SCO MTU: 64:1
UP RUNNING PSCAN
RX bytes:21820 acl:1132 sco:0 events:68 errors:0
TX bytes:1182 acl:11 sco:0 commands:53 errors:0
Run Code Online (Sandbox Code Playgroud)
但是bluetoothctl提示中没有显示任何设备,它给了我这个输出:
[bluetooth]# power on
No default controller available
[bluetooth]# scan on
No default controller available
Run Code Online (Sandbox Code Playgroud)
重新启动或有时挂起/恢复可以解决问题:bluetoothctl将再次识别控制器和再次工作的键盘。
根据rfkill.
的相关输出lspci -v,我想是这样的:
03:00.0 …Run Code Online (Sandbox Code Playgroud) 我刚刚下载了 VLC 3.0 Beta(使用 ubuntu ppa),我想知道如何设置它以流式传输到 chromecast。在 repo 的NEWS中添加了该功能。许多新闻媒体都在报道它。但是,目前还没有关于如何实际使用它的示例。
我知道它不在 GUI 中(已经搜索了源代码)。而且,我不知道如何使用命令行中的代码。
这是我用来安装它的Ubuntu PPA。不过,应该没关系。也不应该是操作系统或系统。这只是软件。您可以自己构建它或在此处下载二进制文件(“每晚”)。
对于使用 systemd 的 Linux 发行版,这两个命令之间有实际区别吗?
systemctl suspendpm-suspend我应该使用或更喜欢哪个?
每当我上班时,我都会打字
xrandr --auto
xrandr --output VGA1 --right-of LVDS1
Run Code Online (Sandbox Code Playgroud)
这让我的第二个显示器工作,但是现在我得到了
xrandr: cannot find crtc for output VGA1
Run Code Online (Sandbox Code Playgroud)
作为参考,这里是 xrandr 的输出,
Screen 0: minimum 320 x 200, current 3286 x 1080, maximum 8192 x 8192
LVDS1 connected 1366x768+1920+0 (normal left inverted right x axis y axis) 277mm x 156mm
1366x768 60.0*+
1360x768 59.8 60.0
1024x768 60.0
800x600 60.3 56.2
640x480 59.9
VGA1 connected (normal left inverted right x axis y axis)
1680x1050 59.9 +
1600x1200 60.0
1680x945 60.0
1400x1050 74.9 60.0
1600x900 …Run Code Online (Sandbox Code Playgroud) 从失败的构建中检查构建日志,以下错误是什么意思,
fatal error: ac_nonexistent.h: No such file or directory #include <ac_nonexistent.h>
Run Code Online (Sandbox Code Playgroud)
这是一些上下文。
configure:6614: $? = 0
configure:6627: result: none needed
configure:6648: checking how to run the C preprocessor
configure:6679: gcc -E -Wdate-time -D_FORTIFY_SOURCE=2 conftest.c
configure:6679: $? = 0
configure:6693: gcc -E -Wdate-time -D_FORTIFY_SOURCE=2 conftest.c
conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory
#include <ac_nonexistent.h>
^
compilation terminated.
configure:6693: $? = 1
configure: failed program was:
| /* confdefs.h */
Run Code Online (Sandbox Code Playgroud)
什么是ac_nonexistent.h?遇到这个错误该怎么办?