1
kgdb00 OP ncdu 命令有和 du 命令一样的问题,这两个都是我用的很多的命令,如果不搞清楚原因,以后都不敢用了。
|
2
ysc3839 2021-11-19 21:37:45 +08:00 via Android
你给出的这段没做好控制变量呀,du -bsh ,du -bs 和 du -bh 的结果如何呢?
|
3
Cooky 2021-11-19 21:43:15 +08:00
文件系统?
|
4
kgdb00 OP @ysc3839
d@desktop:/mnt$ file /usr/bin/du /usr/bin/du: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=eacf80f509266fff220e1672d42d51fbc3094921, for GNU/Linux 3.2.0, stripped d@desktop:/mnt$ d@desktop:/mnt$ /usr/bin/du -bsh 3/Win10_English_x64.iso 4.3G 3/Win10_English_x64.iso d@desktop:/mnt$ d@desktop:/mnt$ /usr/bin/du -bs 3/Win10_English_x64.iso 4556128256 3/Win10_English_x64.iso d@desktop:/mnt$ d@desktop:/mnt$ /usr/bin/du -bh 3/Win10_English_x64.iso 4.3G 3/Win10_English_x64.iso d@desktop:/mnt$ d@desktop:/mnt$ /usr/bin/du -h 3/Win10_English_x64.iso 250M 3/Win10_English_x64.iso d@desktop:/mnt$ d@desktop:/mnt$ /usr/bin/du -sh 3/Win10_English_x64.iso 250M 3/Win10_English_x64.iso d@desktop:/mnt$ d@desktop:/mnt$ |
5
Routeros 2021-11-19 21:58:48 +08:00
蹲一个
|
6
ynyounuo 2021-11-19 21:59:42 +08:00
@kgdb00
-b 是自带 --apparent-size 的 你应该对比 du --block-size=1 和 du -b 合理猜测 du 在这里显示有差异是因为你 U 盘的文件系统不支持 UDF |
7
kgdb00 OP @ynyounuo
root@desktop:/mnt# /usr/bin/du --block-size=1 3/Win10_English_x64.iso 261160960 3/Win10_English_x64.iso root@desktop:/mnt# root@desktop:/mnt# /usr/bin/du -b 3/Win10_English_x64.iso 4556128256 3/Win10_English_x64.iso root@desktop:/mnt# root@desktop:/mnt# |
8
kgdb00 OP @ysc3839 @ynyounuo
其他文件也有同样的情况,只要大于 4GB ,报告的大小就自动减去了 4GB root@desktop:/mnt# /usr/bin/du -h 3/* 2.1G 3/Fedora-Server-dvd-x86_64-35-1.2.iso 1.9G 3/Fedora-Workstation-Live-x86_64-35-1.2.iso 396M 3/gparted-live-1.3.1-1-amd64.iso 2.9G 3/ubuntu-20.04.3-desktop-amd64.iso 1.2G 3/ubuntu-20.04.3-live-server-amd64.iso 3.0G 3/ubuntu-21.10-desktop-amd64.iso 250M 3/Win10_English_x64.iso 1.2G 3/Win11_English_x64.iso # 这个大小也错了 root@desktop:/mnt# root@desktop:/mnt# /usr/bin/du -bh 3/* 2.1G 3/Fedora-Server-dvd-x86_64-35-1.2.iso 1.9G 3/Fedora-Workstation-Live-x86_64-35-1.2.iso 396M 3/gparted-live-1.3.1-1-amd64.iso 2.9G 3/ubuntu-20.04.3-desktop-amd64.iso 1.2G 3/ubuntu-20.04.3-live-server-amd64.iso 3.0G 3/ubuntu-21.10-desktop-amd64.iso 4.3G 3/Win10_English_x64.iso 5.2G 3/Win11_English_x64.iso root@desktop:/mnt# root@desktop:/mnt# /usr/bin/du -b 3/* 2232418304 3/Fedora-Server-dvd-x86_64-35-1.2.iso 2009333760 3/Fedora-Workstation-Live-x86_64-35-1.2.iso 415236096 3/gparted-live-1.3.1-1-amd64.iso 3071934464 3/ubuntu-20.04.3-desktop-amd64.iso 1261371392 3/ubuntu-20.04.3-live-server-amd64.iso 3116482560 3/ubuntu-21.10-desktop-amd64.iso 4556128256 3/Win10_English_x64.iso 5497985024 3/Win11_English_x64.iso root@desktop:/mnt# root@desktop:/mnt# |
10
kgdb00 OP windows 10 里显示的文件大小都是正常的。
|
11
dingwen07 2021-11-19 22:55:29 +08:00
建议你把文件 Hash 一下,大概就知道 U 盘有没有问题了
|
12
kgdb00 OP sha256sum 跟微软官网的是一样的
|
14
ynyounuo 2021-11-19 23:16:25 +08:00
|
15
kokutou 2021-11-19 23:21:11 +08:00 via Android
mount 挂载参数呢?
|
16
kgdb00 OP @ynyounuo
win10 的不一致,win11 的一致 root@server:/c/iso# isoinfo -d -i Win10_English_x64.iso CD-ROM is in ISO 9660 format System id: Volume id: ESD_ISO Volume set id: ESD_ISO Publisher id: Data preparer id: IMAPI2 (1.0) ISO9660 FORMATTER COPYRIGHT (C) 2004-2007 MICROSOFT Application id: Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 2224395 El Torito VD version 1 found, boot catalog is in sector 1404 NO Joliet present NO Rock Ridge present Eltorito validation header: Hid 1 Arch 0 (x86) ID 'Microsoft IMAPIv2' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 8 Bootoff 57D 1405 root@server:/c/iso# root@server:/c/iso# /usr/bin/du -b Win10_English_x64.iso 4556128256 Win10_English_x64.iso root@server:/c/iso# root@server:/c/iso# bc bc 1.07.1 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 2224395 * 2048 4555560960 root@server:/c/iso# isoinfo -d -i Win11_English_x64.iso CD-ROM is in ISO 9660 format System id: Volume id: CCCOMA_X64FRE_EN-US_DV9 Volume set id: CCCOMA_X64FRE_EN-US_DV9 Publisher id: MICROSOFT CORPORATION Data preparer id: MICROSOFT CORPORATION, ONE MICROSOFT WAY, REDMOND WA 98052, (425) 882-8080 Application id: CDIMAGE 2.56 (01/01/2005 TM) Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 2684563 El Torito VD version 1 found, boot catalog is in sector 22 NO Joliet present NO Rock Ridge present Eltorito validation header: Hid 1 Arch 0 (x86) ID 'Microsoft Corporation' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 8 Bootoff 20B 523 root@server:/c/iso# root@server:/c/iso# /usr/bin/du -b Win11_English_x64.iso 5497985024 Win11_English_x64.iso root@server:/c/iso# root@server:/c/iso# bc bc 1.07.1 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 2684563 * 2048 5497985024 |
17
kgdb00 OP @ynyounuo 刚才创建了一个 5GB 的文件,结果大小显示正常
root@laptop:/mnt/1# /usr/bin/dd if=/dev/zero of=5GB obs=1G count=0 seek=5 root@laptop:/mnt/1# /usr/bin/du -h * 5.0G 5GB 2.1G Fedora-Server-dvd-x86_64-35-1.2.iso 1.9G Fedora-Workstation-Live-x86_64-35-1.2.iso 396M gparted-live-1.3.1-1-amd64.iso 2.9G ubuntu-20.04.3-desktop-amd64.iso 1.2G ubuntu-20.04.3-live-server-amd64.iso 3.0G ubuntu-21.10-desktop-amd64.iso 250M Win10_English_x64.iso 1.2G Win11_English_x64.iso root@laptop:/mnt/1# /usr/bin/du -b * 5368709120 5GB 2232418304 Fedora-Server-dvd-x86_64-35-1.2.iso 2009333760 Fedora-Workstation-Live-x86_64-35-1.2.iso 415236096 gparted-live-1.3.1-1-amd64.iso 3071934464 ubuntu-20.04.3-desktop-amd64.iso 1261371392 ubuntu-20.04.3-live-server-amd64.iso 3116482560 ubuntu-21.10-desktop-amd64.iso 4556128256 Win10_English_x64.iso 5497985024 Win11_English_x64.iso root@laptop:/mnt/1# |
18
kgdb00 OP |
19
kgdb00 OP 我上面总共用了 desktop ,server ,laptop 三个设备,可能会让各位感到迷惑,但结果都是一样的。
|
20
kgdb00 OP 而且我发现 win11 上个月正式发布 iso 后,微软好像悄悄又更新了 iso ,我的 sha256 和官网的对不上,但我用 google 搜我的 sha256 这一串,可以搜到好多结果,各位可以试试:
667bd113a4deb717bc49251e7bdc9f09c2db4577481ddfbce376436beb9d1d2f 然后可以去微软官网下载 win11 的页面,点击那个“Verify your download”,没有一个结果和这个是一样的,应该就是微软悄悄更新 ISO 了。 |
21
kgdb00 OP @ynyounuo
用 isoinfo -d -i 的 volume size * block size 和 du -b 的结果相比较是说明什么问题呢? 我发现 fedora server 35 的 iso 也是不一致的,但 sha256sum 和官网的是一致的 root@server:/c/iso# sha256sum Fedora-Server-dvd-x86_64-35-1.2.iso 3fe521d6c7b12c167f3ac4adab14c1f344dd72136ba577aa2bcc4a67bcce2bc6 Fedora-Server-dvd-x86_64-35-1.2.iso root@server:/c/iso# root@server:/c/iso# isoinfo -d -i Fedora-Server-dvd-x86_64-35-1.2.iso CD-ROM is in ISO 9660 format System id: LINUX Volume id: Fedora-S-dvd-x86_64-35 Volume set id: Publisher id: Data preparer id: Application id: GENISOIMAGE ISO 9660/HFS FILESYSTEM CREATOR (C) 1993 E.YOUNGDALE (C) 1997-2006 J.PEARSON/J.SCHILLING (C) 2006-2007 CDRKIT TEAM Copyright File id: Abstract File id: Bibliographic File id: Volume set size is: 1 Volume set sequence number is: 1 Logical block size is: 2048 Volume size is: 1089891 El Torito VD version 1 found, boot catalog is in sector 380 Joliet with UCS level 3 found Rock Ridge signatures version 1 found Eltorito validation header: Hid 1 Arch 0 (x86) ID '' Key 55 AA Eltorito defaultboot header: Bootid 88 (bootable) Boot media 0 (No Emulation Boot) Load segment 0 Sys type 0 Nsect 4 Bootoff 50BAD 330669 root@server:/c/iso# root@server:/c/iso# /usr/bin/du -b Fedora-Server-dvd-x86_64-35-1.2.iso 2232418304 Fedora-Server-dvd-x86_64-35-1.2.iso root@server:/c/iso# root@server:/c/iso# stat Fedora-Server-dvd-x86_64-35-1.2.iso File: Fedora-Server-dvd-x86_64-35-1.2.iso Size: 2232418304 Blocks: 4360200 IO Block: 4096 regular file Device: 801h/2049d Inode: 4194318 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 1000/ d) Gid: ( 1000/ d) Access: 2021-11-20 00:03:38.167116659 +0800 Modify: 2021-11-05 07:15:49.224372134 +0800 Change: 2021-11-05 07:24:56.164238609 +0800 Birth: 2021-11-05 07:10:48.164996198 +0800 root@server:/c/iso# root@server:/c/iso# bc bc 1.07.1 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 1089891 * 2048 2232096768 |
22
bitdepth 2021-11-20 02:11:18 +08:00 via iPad
是不是那種用量產工具偽造儲存空間的隨身碟?
|
23
kokutou 2021-11-20 07:58:35 +08:00 via Android
如果换个不同品牌不同型号的 u 盘呢?
|
26
kgdb00 OP @bitdepth 不太理解你说的意思,我这个 u 盘是这款:
“闪迪(SanDisk)32GB Micro USB 接口 U 盘 DD3 酷捷 黑色 读速 150MB/s 安卓手机平板三用 便携 APP 管理软件” 京东自营还有在售,不过我是 5 年前买的,所以担心会不会是用久了出现质量问题了,不过数据拷贝进去都没有任何的损坏,也不能因为这一个问题就断定 u 盘坏了。 |
27
kgdb00 OP |