AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-614907

Daniel's questions

Martin Hope
Daniel
Asked: 2020-10-09 08:59:53 +0800 CST

我可以在两个主机系统之间共享 docker overlay2 吗?

  • 0

我想在我的本地计算机上安装两个系统,例如:Ubuntu 和 Arch。

我知道这些系统的所有库、系统设置、用户设置都应该是不同的。

但在以下情况下:

  • 泊坞窗(/var/lib/docker/overlay2)
  • 快照(/var/lib/snapd/snaps)

我不怀疑差异,并希望将这些目录安装到两个系统的相同磁盘空间。

它应该工作稳定,还是我应该怀疑这个问题?

dual-boot mount hard-drive symbolic-link docker
  • 1 个回答
  • 162 Views
Martin Hope
Daniel
Asked: 2020-07-16 10:30:45 +0800 CST

gparted 和 df 硬盘大小的区别

  • 0

在df -h输出中我可以看到:

Filesystem      Size  Used Avail Use% Mounted on                                                                                   
/dev/sda1       234G   60M  222G   1% /media/daniel/0dabcbae-b766-4aba-84f0-f7ab39b354fb

那么未使用且不能同时使用的 12 GB 在哪里呢?

我检查了它gparted并看到:

  • 大小 238.47 GiB
  • 占用 4.80 GiB
  • 可用 233.67 GiB
233.67 + 4.8 = 238.47

所以gparted结果是合乎逻辑的。选定的文件系统 ext4。

我无法从该硬盘中删除 4.8 GB。我将其格式化为 ext4、fat32,再次为 ext4,但仍然显示可见的已用空间量。

问题 1。

为什么我不能擦硬盘?

问题2。

为什么结果df与 gparted 不同?

问题 3。

为什么 used 和 available 的总和不等于大小df?

partitioning gparted disk-usage hard-drive df
  • 1 个回答
  • 248 Views
Martin Hope
Daniel
Asked: 2017-09-19 09:46:10 +0800 CST

`du`显示空目录的非零大小[重复]

  • 0
这个问题在这里已经有了答案:
du(磁盘使用情况)报告 6.1M 但目录为空 2 个答案
4年前关闭。

我知道,当我创建空目录时,它有自己的大小:

mkdir test && du -h test

给出:

4,0K    test

但这种情况是另一回事。我在外部硬盘(ext4)上有包含 1e6 个文件(74 GB)的目录。我处理了这些文件,保存在其他目录中,并以并行脚本从该位置删除。现在这个目录应该是空的。所以没关系

ls -a raw/all

打印

.  ..

但

du -h raw/all

给

19M     raw/all

没有-h我们正好有 19288B。这也是一个奇怪的结果:

ls -la raw/all

total 19292
drwxr-xr-x 2 daniel daniel 19746816 wrz 18 19:23 .
drwxrwxr-x 4 daniel daniel     4096 wrz 17 13:21 .. 

到底是怎么回事?du命令中有缓存吗?或者在处理了这么多文件之后,这些文件之后还有什么休息吗?unlink我在 perl5 脚本中删除了归档。

更新 - 评论问题的答案

ls -aiR raw/all
raw/all:
51647758 .  51647760 ..

lsof +L1 

打印 44 行,但与此目录无关。但是lsof给出一些数字,比如19746816.

lsof | grep raw
bash      5355                daniel  cwd       DIR               8,17  19746816   51647758 /media/daniel/f2971ccd-4841-4da3-8ce3-d9f2cc03fc27/daniel/pro/scraper/raw/all
lsof      5677                daniel  cwd       DIR               8,17  19746816   51647758 /media/daniel/f2971ccd-4841-4da3-8ce3-d9f2cc03fc27/daniel/pro/scraper/raw/all
grep      5678                daniel  cwd       DIR               8,17  19746816   51647758 /media/daniel/f2971ccd-4841-4da3-8ce3-d9f2cc03fc27/daniel/pro/scraper/raw/all
lsof      5679                daniel  cwd       DIR               8,17  19746816   51647758 /media/daniel/f2971ccd-4841-4da3-8ce3-d9f2cc03fc27/daniel/pro/scraper/raw/all

笔记本电脑被重新启动。外部驱动器已断开连接。但du仍然显示19M。

partitioning
  • 1 个回答
  • 527 Views
Martin Hope
Daniel
Asked: 2017-08-17 06:51:46 +0800 CST

以最佳方式获得的目录中第一个文件的名称

  • 3

普通当我想显示目录中第一个文件的名称时,我键入:

ls raw/all | head -n 1

但是在目录中有很多文件时需要很长时间


例如,对于具有接近 900 k 文件的目录,我们有以下测量结果:

time ls raw/all | head -n 1 

real    0m17.250s | 0m10.328s | 0m6.334s
user    0m3.224s  | 0m3.884s  | 0m3.192s
sys     0m0.544s  | 0m0.664s  | 0m0.572s

while 循环遍历所有文件需要:

time ls raw/all | wc -l

real    0m6.455s | 0m5.869s  | 0m5.228s
user    0m3.612s | 0m3.468s  | 0m4.072s
sys     0m0.460s | 0m0.784s  | 0m0.624s

如何以有效的方式打印第一个文件的名称?

command-line
  • 1 个回答
  • 6529 Views
Martin Hope
Daniel
Asked: 2017-05-17 21:44:10 +0800 CST

软件包已安装但未检测到。(毕业)

  • 1

我通过典型方式安装了 gradle:

sudo apt install gradle
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gradle is already the newest version (3.5-0ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 8 not to upgrade.

接下来我想使用这个程序:

$ gradle 
The program 'gradle' is currently not installed. You can install it by typing:
sudo apt install gradle

我试图删除 java,清除 gradle,从任何地方删除它并重新安装。没有任何帮助......最令人困惑的是,这个包几天前可以正常工作,没有任何问题。

下面是一些调试:

$ which gradle
$ whereis gradle
gradle:
$ apt-cache policy gradle
gradle:
  Installed: 3.5-0ubuntu1
  Candidate: 3.5-0ubuntu1
  Version table:
 *** 3.5-0ubuntu1 500
        500 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main amd64 Packages
        500 http://ppa.launchpad.net/cwchien/gradle/ubuntu xenial/main i386 Packages
        100 /var/lib/dpkg/status
     2.10-1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial/universe i386 Packages
     1.4-2ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu trusty/universe amd64 Packages
        500 http://us.archive.ubuntu.com/ubuntu trusty/universe i386 Packages

当正确检测到这个包时,如何将系统恢复到状态?

更新

我找到了命令:

sudo apt-get clean

现在我得到:

sudo apt install gradle
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gradle is already the newest version (3.5-0ubuntu1).
0 to upgrade, 0 to newly install, 0 to remove and 8 not to upgrade.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (main/i18n/Translation-en_GB) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target Translations (main/i18n/Translation-pl) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1
W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/docker.list:1

更新2

dpkg -L gradle
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/gradle
/usr/share/doc/gradle/changelog.Debian.gz
/usr/share/doc/gradle/copyright

namei -lx /usr/bin/gradle
f: /usr/bin/gradle
Drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
                     gradle - No such file or directory
software-installation
  • 1 个回答
  • 4596 Views
Martin Hope
Daniel
Asked: 2017-01-08 18:19:31 +0800 CST

Wine 错误:“fixme:win:EnumDisplayDevicesW ((null),0,0x33f4b4,0x00000000),存根!”

  • 2

错误:

我正在尝试通过 wine 运行应用程序,并得到错误:

fixme:win:EnumDisplayDevicesW ((null),0,0x33f4b4,0x00000000), stub!
fixme:d3d_surface:surface_init Trying to create a render target that isn't in the default pool.
fixme:winediag:AUDDRV_GetAudioEndpoint Winepulse is not officially supported by the wine project
fixme:winediag:AUDDRV_GetAudioEndpoint For sound related feedback and support, please visit http://ubuntuforums.org/showthread.php?t=1960599
fixme:d3d_surface:wined3d_surface_flip Ignoring flags 0x1.

如何解决这个问题?

系统信息:

Ubuntu版本:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.1 LTS
Release:    16.04
Codename:   xenial

葡萄酒版:

wine --version
wine-1.6.2

显卡:

sudo lshw -C video[sudo] hasło użytkownika daniel: 
  *-display               
       description: VGA compatible controller
       product: Broadwell-U Integrated Graphics
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 09
       width: 64 bits
       clock: 33MHz
       capabilities: msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:49 memory:f5000000-f5ffffff memory:d0000000-dfffffff ioport:f000(size=64)
  *-display UNCLAIMED
       description: 3D controller
       product: GM108M [GeForce 840M]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:08:00.0
       version: a2
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list
       configuration: latency=0
       resources: memory:f6000000-f6ffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:d000(size=128) memory:f7000000-f707ffff
wine
  • 1 个回答
  • 8185 Views
Martin Hope
Daniel
Asked: 2016-12-03 07:40:56 +0800 CST

访问启动和关闭日志

  • 5

我的问题受到项目的启发rawhen

该项目使用命令(源代码last -R -F reboot中的第 163 行)来查看计算机运行的时间段。您可以在文档中看到,该命令允许我们查看例如.83 days ago - 447 hours

原始文档

该项目已经 4 年没有更新了。

2年前在这个网站上有人问过这个问题:如何使用“last”命令读取旧的登录信息?答案表明:

last -2000 -f /var/log/wtmp.1                       // 83 lines (28 days)

如果我过滤这个我得到。

last -R -F reboot -f /var/log/wtmp.1                // 33 lines (28 days)

但在这个答案中,建议的行数是 2000,并且似乎有一个日志假设,比如数字/var/log/wtmp.x在哪里x。

在我/var/log只有两个文件wtmp:

wc /var/log/wtmp*
    3    19  6144 /var/log/wtmp
   37   253 93696 /var/log/wtmp.1
   40   272 99840 together

这些文件仅包含过去 1-2 个月的数据。

我的问题是:

如何访问最旧的日志或防止 Ubuntu 删除它们,或将这些日志保存在一个文件中(我只需要重新启动过滤器)而不会出现连接这些数据的问题。

我的系统是 Ubuntu 16.04。它是标准家庭版,而不是服务器。

这可能是一个意外,但我明白了,rawhen它显示478 h上个月计算机打开了 447 小时,本月打开了 10 小时。是否有任何运行系统的时间之后删除日志?

command-line
  • 1 个回答
  • 1578 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve