ext3 檔案大小上限只有 20G - Linux

Charlotte avatar
By Charlotte
at 2020-04-08T11:36

Table of Contents

在 8T 的外接硬碟 (My Book) 上格式化了 ext3 ,
但不知道是什麼原因,檔案大小上限只能到 20G 。
truncate -s 19G 還能成功, 20G 就會報錯了。

google 到的說法,
如果 block size 是 4k ,那上限應該是 16T ,
用 tune2fs 列出的 block size 也的確是 4096 ;
但實際上卻只能建立最大 20G (2048000000 byte) 大小的檔案。
不知道為什麼是 20G 這個奇怪的數字。

在掛載的時候,的確是用 ext3 去掛載的,沒有用到 ext2 。

用 tune2fs 列出的屬性:

```
tune2fs 1.44.5 (15-Dec-2018)
Filesystem volume name: <none>
Last mounted on: /mnt/backup
Filesystem UUID: xxxx
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 488382464
Block count: 1953506299
Reserved block count: 97675313
Free blocks: 1274808137
Free inodes: 487903751
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 558
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Filesystem created: Fri Aug 2 18:49:51 2019
Last mount time: Wed Apr 8 10:13:34 2020
Last write time: Wed Apr 8 10:46:48 2020
Mount count: 93
Maximum mount count: -1
Last checked: Sat Aug 3 08:03:15 2019
Check interval: 0 (<none>)
Lifetime writes: 2774 GB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 1430fead-0972-4ab8-90aa-784a0b48e68d
Journal backup: inode blocks
```

--
一位記者問總理:「請問總理先生,現在的中國人都窮吧?」不少人納悶:怎麼提這種問題?大家都關注總理怎樣回答。總理肯定地說:「不是的!」全場嘩然,議論紛紛。總理看出了大家的疑惑,補充說了一句:「當官的不窮。」頓時掌聲雷動。總理的機智打動了在場的所有人,掌聲經久不息。

--
Tags: Linux

All Comments

Charlotte avatar
By Charlotte
at 2020-04-09T16:38
主機是cpu和os是幾bit的作業系統? truncate理論上是用
truncate system call去實作,而trucate的長度參數是off_t
Zora avatar
By Zora
at 2020-04-10T05:52
,所以不同機器的上限可能會因為cpu,os的限制而有所不同
man 2 truncate
Steve avatar
By Steve
at 2020-04-13T20:56
寫個c程式 printf("%d", sizeof(off_t)); 就可以知道
Agnes avatar
By Agnes
at 2020-04-15T15:07
不能改用ext4嗎? ext3的年代硬碟真的很小,大容量硬碟出來
的年代預設都是ext4,遇到了詭異問題如何可以先閃就閃
Liam avatar
By Liam
at 2020-04-16T23:51
如果可以
Ingrid avatar
By Ingrid
at 2020-04-20T07:30
那就XFS吧,幾乎大家都能掛,頂多沒有修復工具
Christine avatar
By Christine
at 2020-04-20T17:02
XD 你應該沒在用虛擬機器,隨便一個虛擬機器的虛擬硬碟都
幾十GB上百GB的
Quanna avatar
By Quanna
at 2020-04-25T12:04
為了避免等一下被叫出來踹共,先自行出來跪算盤。

makefile 引入問題

Ingrid avatar
By Ingrid
at 2020-04-07T23:27
小弟最近剛入門Linux 想嘗試一些階層式makefile管理 踢到鐵板...來問兩個蠢問題 環境: ubuntu 16.04 架構: /home/xx/main - main.c - makefile /home/xx/plus - plus.c - plus.mk makefi ...

樹莓派3 的vnc無法連線

James avatar
By James
at 2020-04-06T00:47
如題 試過以下指令! https://i.imgur.com/QWKN00x.jpg 也用rasp-config 要啟動 vnc 結果跳出下圖錯誤 https://i.imgur.com/IktXrtU.jpg 拜託 大神救我 幾天前明明還好好的... - ...

spyder開啟問題

Mary avatar
By Mary
at 2020-04-04T13:11
請問Ubuntu server 是不是無法開啟anaconda裡的spyder? 試了兩個ubuntu server都遇到同樣的問題 但其他圖形化介面卻能夠用遠端開啟 我也有裝Ubuntu桌面版 遠端的話卻可以遠端開啟圖形化spyder介面 所以想問是不是因為server版的問題? https://i.i ...

ubuntu強制關機快十次。

Emily avatar
By Emily
at 2020-04-03T18:04
如題,今天在用ubuntu的時候電腦突然死當,強制關機以後再次開機,用chrome的時候又是 死當,後來再開機就開不了了。 顯示一行指令碼似乎是說有個log損毀之類的。 試著用recovery mode也是無法,用舊的kernel再開了一次recovery mode,輸入disk的密碼 以後就陷入黑屏,可以 ...

Windows10 Ubuntu16.04 無法共用剪貼簿

Isla avatar
By Isla
at 2020-04-03T00:02
大家好~ 目前實體端是Windows 10,安裝Virtual Box 6.1.4,並裝了Ubuntu 16.04。 網路上找了一篇共用剪貼簿的教學文:https://reurl.cc/mnGael 但按照教學文的步驟進行後,仍然無法在兩邊複製剪貼,不太知道問題出在哪裡。 求助高手解惑,感激不盡~ - ...