小编Jér*_*ôme的帖子

grub-install:文件描述符 3 在 vgs 调用中泄露

我在软件 RAID 1 中的 LVM 上安装了 Debian Jessie。

为了确保MBR写在RAID 1的两个磁盘上,我运行dpkg-reconfigure grub-pc(如建议在这里),然后选择两个磁盘。

我收到这些错误:

root@bouzin:/home/jerome# dpkg-reconfigure grub-pc
Installing for i386-pc platform.
File descriptor 3 (pipe:[1038681]) leaked on vgs invocation. Parent PID 4760: grub-install
File descriptor 3 (pipe:[1038681]) leaked on vgs invocation. Parent PID 4760: grub-install
File descriptor 3 (pipe:[1038681]) leaked on vgs invocation. Parent PID 4760: grub-install
Installation finished. No error reported.
Installing for i386-pc platform.
File descriptor 3 (pipe:[1038681]) leaked on vgs invocation. Parent PID 4789: grub-install …
Run Code Online (Sandbox Code Playgroud)

software-raid lvm grub2

20
推荐指数
1
解决办法
3万
查看次数

使用 virt-install 从命令行安装 VM

免责声明:

我现在virt-manager用来创建和管理我的虚拟机,它真的是一个救星。如果主机没有图形显示,它可以远程使用(从第三台机器,通常是您的工作站)。

vnc在我发现的安装教程中出现的情况让我认为“推荐”过程需要在主机、来宾或两者上都有 X 东西。绝对不。我的错。如果您处于相同的情况,请在尝试从命令行安装 VM 之前三思而后行。


我正在尝试在 Debian 主机中安装 Debian VM virt-install,但我不知道如何将 .iso 映像传递给它。

virt-install --connect qemu:///system --virt-type kvm --name prod --ram 6144 --disk /srv/vm/prod.qcow,format=qcow2,size=10 --location=/home/jerome/debian-8.0.0-amd64-netinst.iso --network bridge=br0 --os-type linux --os-variant debianwheezy --extra-args='console=tty0 console=ttyS0,115200n8 serial'

Starting install...
Retrieving file info...                                                                                                                                         |  160 B     00:00 ... 
ERROR    Could not find an installable distribution at '/home/jerome/debian-8.0.0-amd64-netinst.iso'
The location must be the root directory of an install tree.
Domain installation does not appear to have been successful.
If …
Run Code Online (Sandbox Code Playgroud)

kvm

16
推荐指数
2
解决办法
5万
查看次数

说明符解析:%i 和 %I 区别?

我正在尝试将 celery 作为服务运行,如文档中所述

该文档使用%n%I日志文件的说明符:

芹菜服务:

ExecStart= [...] --logfile=${CELERYD_LOG_FILE}
Run Code Online (Sandbox Code Playgroud)

celery.service.d/celery.conf

Environment="CELERYD_LOG_FILE=/var/log/celery/%n%I.log"
Run Code Online (Sandbox Code Playgroud)

执行此操作时,我可以%n在开始时解决的服务状态中看到%I 保持在此阶段:

systemctl status celery.service
[...]
    --logfile=/var/log/celery/worker%I.log
Run Code Online (Sandbox Code Playgroud)

我得到了那些日志文件:

/var/log/celery/worker.log
/var/log/celery/worker-1.log
/var/log/celery/worker-2.log
Run Code Online (Sandbox Code Playgroud)

%i但是,如果我使用,则整个事情都会在开始时解决

celery.service.d/celery.conf

Environment="CELERYD_LOG_FILE=/var/log/celery/%n%i.log"
Run Code Online (Sandbox Code Playgroud)

产生这个:

systemctl status celery.service
[...]
    --logfile=/var/log/celery/celery.service.log
Run Code Online (Sandbox Code Playgroud)

我只得到一个日志文件:

/var/log/celery/celery.service.log
Run Code Online (Sandbox Code Playgroud)

这令人不安。

systemd 文档来看,唯一的区别应该是转义:

  • "%i" | 实例名称 | 对于实例化单元:这是“@”字符和单元名称后缀之间的字符串。
  • "%I" | 未转义的实例名称 | 与 "%i" 相同,但转义已撤消

有什么我想念的吗?

另外,我注意到如果我直接在.service文件中设置日志路径,则只%n%i接受表单。

ExecStart= [...] --logfile=/var/log/celery/%n%i.log
Run Code Online (Sandbox Code Playgroud)

会做,并导致

/var/log/celery/celery.service.log
Run Code Online (Sandbox Code Playgroud)

尽管

ExecStart= [...] --logfile=/var/log/celery/%n%I.log
Run Code Online (Sandbox Code Playgroud)

触发错误:

celery.service failed to run 'start' task: Operation not …
Run Code Online (Sandbox Code Playgroud)

systemd

10
推荐指数
1
解决办法
1万
查看次数

rsyslog filling up /var/log puts the system down

Sometimes a process goes wrong and the logs in /var/log grow up so much they ultimately fill up the whole partition.

It happened me once on a server due to a wrong postfix config, and once on a desktop due to a USB printer (not sure exactly what went wrong, all I know is the logs where filled with (hp) did not claim interface 1 before use).

I know the root cause is not the logger but the application. …

logs disk-usage rsyslog syslog

8
推荐指数
1
解决办法
5534
查看次数

文件系统以 root 身份挂载但归用户所有。为什么?

我正在安装一个文件系统root,我不明白为什么它不是root由非特权用户拥有而是由非特权用户拥有。

这是 fstab:

cat /etc/fstab
[...]
/dev/sdb        /mnt/projects ext4 defaults 0 2
Run Code Online (Sandbox Code Playgroud)

这是安装时发生的情况:

ls -al /mnt/projects/ 
total 8
drwxr-xr-x 2 root root 4096 mai   25 17:55 .
drwxr-xr-x 3 root root 4096 mai   25 17:55 ..

mount /dev/sdb

ls -al /mnt/projects/ 
total 24
drwx------ 3 jerome jerome  4096 mai   25 17:52 .
drwxr-xr-x 3 root   root    4096 mai   25 17:55 ..
drwx------ 2 root   root   16384 mai   25 17:52 lost+found
Run Code Online (Sandbox Code Playgroud)

我不使用sudo. 我root用 …

mount ownership

8
推荐指数
1
解决办法
2278
查看次数

恢复 LVM(在 RAID1 上):未找到卷组。分区表被删除了?

我正在尝试使用 Debian Live 恢复 RAID1 上的 LVM(无加密)。

\n\n

显然,RAID1 可以毫无问题地组装,但 LVM 已损坏。您可以跳至 LVM 部分。保留 RAID 部分以备不时之需。

\n\n

RAID

\n\n
# aptitude install mdadm\n# mdadm --assemble --scan\n
Run Code Online (Sandbox Code Playgroud)\n\n

消息:

\n\n
[  617.036709] md: md0 stopped.\n[  617.038099] md: bind<sdc1>\n[  617.038302] md: bind<sda1>\n[  617.214903] md: raid1 personality registered for level 1\n[  617.215534] md/raid1:md0: active with 2 out of 2 mirrors\n[  617.215694] created bitmap (8 pages) for device md0\n[  617.215956] md0: bitmap initialized from disk: read 1 pages, set 0 of\n14903 bits\n[  617.682354] md0: …
Run Code Online (Sandbox Code Playgroud)

raid lvm data-recovery

6
推荐指数
1
解决办法
7861
查看次数

以非特权用户身份格式化 USB 驱动器

我一直认为非特权用户无法格式化USB驱动器,只有root用户可以,所以我曾经搞砸了gpartedfdisk

经过多年或每天的 Linux 使用,我才发现gnome-disk-utility允许用户在没有管理员权限的情况下格式化 USB 驱动器。

我猜用户需要属于允许挂载/卸载(plugdev在 Debian 上)的同一组,并且权限的管理方式相同(例如,您不能卸载或分区系统分区)。

格式化 USB 驱动器的推荐方法是什么?

我在 Internet 上找到的几乎所有建议都涉及fdiskgparted,因此是root。但即使您可以root在您的系统上登录,在root不必要的时候登录也是不好的做法。

从这个角度来说, gnome-disk-utility来之不易。

是否有等效于的 CLI gnome-disk-utility?非侏儒图形等价物?

partition not-root-user

6
推荐指数
1
解决办法
2668
查看次数

ntpd 运行但未同步的虚拟机

TL; DR

VM使用KVM,时间不同步。暂停 2 分钟后,它会保持永久的 2 分钟间隔。使用不同的网络配置设置另一个 VM 显示网络配置阻止 ntp 工作。修复此网络问题已不合时宜。

但是,没有网络问题的新虚拟机在恢复后也不同步。相同的测试:暂停 2 分钟。使用正确同步的机器检查日期差异。2 分钟的延迟是永久性的。

这似乎是一个常见问题,关于如何保持 VM 同步以及同时使用 NTP 和 kvm-clock 存在争议。我找到了很多参考资料,但没有答案。

我有一个 Debian VMntpd正在运行但没有更正时间。例如,在暂停/恢复之后,我得到了 2 分钟的永久偏移。

/etc/ntp.conf 是默认的或接近默认的,没什么特别的:

# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help

driftfile /var/lib/ntp/ntp.drift


# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable …
Run Code Online (Sandbox Code Playgroud)

kvm ntpd

5
推荐指数
1
解决办法
6385
查看次数

unattended-upgrades 不会从 backport 升级包

unattended-upgrades工作正常,我每天都会收到更新,但偶尔,当我打开时aptitude,我意识到 backports 包不会自动升级。

这发生在两台不同的机器(台式机和服务器)上,都是 Debian Jessie。

我的配置有什么问题吗?

/etc/apt/apt.conf.d/50unattended-upgrades

Unattended-Upgrade::Origins-Pattern {
      "o=Debian,n=jessie";
      "o=Debian,n=jessie-updates";
      "o=Debian,n=jessie-backports";
      "o=Debian,n=jessie-proposed-updates";
      "o=Debian,n=jessie,l=Debian-Security";
};

/etc/apt/sources.list

deb http://ftp.fr.debian.org/debian/ jessie main contrib non-free
deb http://security.debian.org/ jessie/updates main
deb http://ftp.fr.debian.org/debian/ jessie-updates main
deb http://ftp.fr.debian.org/debian/ jessie-backports main
Run Code Online (Sandbox Code Playgroud)

debian apt software-updates unattended-upgrades

5
推荐指数
1
解决办法
1674
查看次数

禁用笔记本电脑指点杆

如何禁用笔记本电脑的指点杆(键盘中间的鼠标指针)?

BIOS 中唯一可用的选项也禁用触摸板,因此需要从操作系统完成。

hardware laptop

1
推荐指数
1
解决办法
3199
查看次数