EXT4 需要两倍的存储空间 - Ubuntu / Beets

EXT4 需要两倍的存储空间 - Ubuntu / Beets

我有一个问题正在努力寻找答案。我正在家里构建一个 Ubuntu 媒体服务器,并决定将我的 2TB 大容量存储磁盘划分为不同的分区。

我为音乐创建了一个 700GB 的分区并格式化为 EXT4。然后从 NTFS 外部硬盘迁移大约 370GB,使用 Beets 构建我的音乐库并复制文件。问题是总目录大小超过 730GB!

为什么是这样? Beets 处理文件的方式是否有错误?或者这与文件系统选择有关?

Beets 正在获取专辑封面和其他一些元数据,但这肯定不会使总体足迹增加两倍?

任何建议表示赞赏!我是 Linux 文件系统的新手,所以可能缺少一些关于索引节点、日志的基本知识?

dumep2fs 显示:

chris@MICROSERVER:~$ sudo dumpe2fs /dev/mapper/MICROSERVER--vg-music 
[sudo] password for chris: 
dumpe2fs 1.42.9 (4-Feb-2014)
Filesystem volume name:   <none>
Last mounted on:          /media/ubuntu/62c278e1-4c1e-470a-b68c-f0a5d777c165
Filesystem UUID:          62c278e1-4c1e-470a-b68c-f0a5d777c165
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
cFilesystem features:      has_journal ext_attr resize_inode dir_index filetype needs_recovery 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:              1966080
Block count:              7864320
Reserved block count:     393216
Free blocks:              7681951
Free inodes:              1966057
First block:              0
Block size:               4096
Fragment size:            4096
Reserved GDT blocks:      1022
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Filesystem created:       Sat Jul 25 10:22:35 2015
Last mount time:          Sun Aug  2 21:28:44 2015
Last write time:          Sun Aug  2 21:28:44 2015
Mount count:              23
Maximum mount count:      -1
Last checked:             Sat Jul 25 10:22:35 2015
Check interval:           0 (<none>)
Lifetime writes:          121 MB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:           256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      f7ccf1c6-402b-4666-bdd1-2a10d7fa1948
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x00000023
Journal start:            0

df-h

chris@MICROSERVER:~$ df -h
Filesystem                          Size  Used Avail Use% Mounted on
/dev/mapper/MICROSERVER--vg-root     20G   12G  7.5G  60% /
none                                4.0K     0  4.0K   0% /sys/fs/cgroup
udev                                3.9G  4.0K  3.9G   1% /dev
tmpfs                               796M  1.2M  795M   1% /run
none                                5.0M     0  5.0M   0% /run/lock
none                                3.9G     0  3.9G   0% /run/shm
none                                100M     0  100M   0% /run/user
/dev/sda1                           236M   98M  126M  44% /boot
/dev/mapper/MICROSERVER--vg-music   673G  641G  372K 100% /media/music
/dev/mapper/MICROSERVER--vg-backup   50G   38G  9.3G  81% /media/backup
/dev/sdb2                           673G   33G  606G   6% /music

df-i

Filesystem                           Inodes  IUsed    IFree IUse% Mounted on
/dev/mapper/MICROSERVER--vg-root    1310720 267682  1043038   21% /
none                                1017972      2  1017970    1% /sys/fs/cgroup
udev                                1006939    502  1006437    1% /dev
tmpfs                               1017972    514  1017458    1% /run
none                                1017972      5  1017967    1% /run/lock
none                                1017972      1  1017971    1% /run/shm
none                                1017972      2  1017970    1% /run/user
/dev/sda1                             62248    311    61937    1% /boot
/dev/mapper/MICROSERVER--vg-music  44802048  97110 44704938    1% /media/music
/dev/mapper/MICROSERVER--vg-backup  3276800   1434  3275366    1% /media/backup
/dev/sdb2                          44802048  11710 44790338    1% /music

lsblk-b

NAME                              MAJ:MIN RM          SIZE RO TYPE MOUNTPOINT
sda                                 8:0    0  160041885696  0 disk 
├─sda1                              8:1    0     254803968  0 part /boot
├─sda2                              8:2    0          1024  0 part 
└─sda5                              8:5    0  159784108032  0 part 
  ├─MICROSERVER--vg-root (dm-0)   252:0    0   21441282048  0 lvm  /
  ├─MICROSERVER--vg-swap_1 (dm-1) 252:1    0    8552185856  0 lvm  [SWAP]
  ├─MICROSERVER--vg-music (dm-2)  252:2    0   32212254720  0 lvm  
  └─MICROSERVER--vg-backup (dm-3) 252:3    0   53687091200  0 lvm  /media/backup
sdb                                 8:16   0 2000398934016  0 disk 
├─sdb1                              8:17   0  734003200000  0 part /media/music
└─sdb2                              8:18   0  734003200000  0 part /music

/dev/mapper/MICROSERVER--vg-root on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/cgroup type tmpfs (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)
none on /sys/fs/pstore type pstore (rw)
/dev/sda1 on /boot type ext2 (rw)
/dev/mapper/MICROSERVER--vg-music on /media/music type ext3 (rw)
/dev/mapper/MICROSERVER--vg-backup on /media/backup type ext3 (rw)
/dev/sdb2 on /music type ext4 (rw)
/dev/sdb1 on /media/music type ext4 (rw)
systemd on /sys/fs/cgroup/systemd type cgroup (rw,noexec,nosuid,nodev,none,name=systemd)

须藤lvdisplay

--- Logical volume ---
LV Path                /dev/MICROSERVER-vg/root
LV Name                root
VG Name                MICROSERVER-vg
LV UUID                Lwx28M-m2k9-XIpB-fUEC-HiWa-5QsN-SlNOt3
LV Write Access        read/write
LV Creation host, time MICROSERVER, 2015-07-24 20:55:58 +0100
LV Status              available
# open                 1
LV Size                19.97 GiB
Current LE             5112
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           252:0

--- Logical volume ---
LV Path                /dev/MICROSERVER-vg/swap_1
LV Name                swap_1
VG Name                MICROSERVER-vg
LV UUID                vFQxWC-g7xw-Ilc0-Eixj-51Fv-HaXV-t3uAuq
LV Write Access        read/write
LV Creation host, time MICROSERVER, 2015-07-24 20:55:58 +0100
LV Status              available
# open                 2
LV Size                7.96 GiB
Current LE             2039
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           252:1

--- Logical volume ---
LV Path                /dev/MICROSERVER-vg/music
LV Name                music
VG Name                MICROSERVER-vg
LV UUID                AA9x7O-ZBRd-uBr4-6hPO-jMeS-3ien-r6zvew
LV Write Access        read/write
LV Creation host, time MICROSERVER, 2015-07-25 10:19:33 +0100
LV Status              available
# open                 1
LV Size                30.00 GiB
Current LE             7680
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           252:2

--- Logical volume ---
LV Path                /dev/MICROSERVER-vg/backup
LV Name                backup
VG Name                MICROSERVER-vg
LV UUID                o6tyxv-eTik-OcpX-KhdE-rI4h-z4Rq-tG2NUS
LV Write Access        read/write
LV Creation host, time MICROSERVER, 2015-07-25 20:58:27 +0100
LV Status              available
# open                 1
LV Size                50.00 GiB
Current LE             12800
Segments               1
Allocation             inherit
Read ahead sectors     auto
- currently set to     256
Block device           252:3

为了添加更多上下文,我使用甜菜将数据从 /music 移动到 /media/music。原始音乐库大小约为 370GB。

答案1

虽然我从未使用过甜菜,但我可以给你一些一般信息。首先,至少在一方面,你是正确的。一般来说,300GB的数据就是300GB的数据。文件系统不应该太重要。您可以检查一些事项以确保一切顺利进行。

首先是免费的索引节点。当您运行时,df -h您应该获得格式良好的可用空间。如果你使用df -i你会得到 inode 统计信息。您有可能(但不太可能)耗尽索引节点而不是实际空间。许多小文件可能会发生这种情况。

其次,更有可能的是,嵌入的专辑封面确实会占用那么多空间。它必须嵌入到每个 MP3 中。因此,一张包含 15 首歌曲和专辑封面(包含正面、背面和插入图像)的专辑,每张图像的分辨率均为 700k,仅增加了 31.5 Megs。

第三,确保甜菜不是复制,而是移动。它尝试从 /music 复制到 /music/processed 并且 /music 是安装点,那么你将轻松地将空间增加一倍。即使作为处理的一部分它从 /old_music 移动到 /music 也是如此副本从 /music 到 /music/processed。

相关内容