ext3 파일 시스템에서 복사된 파일은 동일한 크기의 ext4 파일 시스템에 맞지 않습니다.
재현 방법:
1GB 파일 2개를 생성하고,
각각 루프 장치를 설정하고,
파일 시스템 1 ext3, 1 ext4,
산,
/usr/lib의 rsync 파일이 가득 찰 때까지 ext3 폴더로,
ext3 폴더에서 ext4로 파일 동기화를 시도했지만 디스크 공간 문제로 인해 실패했습니다.
ext3 폴더의 모든 파일을 ext4 폴더에 맞추고 싶습니다.
(로그를 보면 다음 복사할 파일이 사용 가능한 공간보다 크고 아직 복사해야 할 파일이 일부 있습니다.)
누군가 이유를 설명할 수 있나요? 아니면 ext4를 사용하여 동일하거나 더 많은 여유 디스크 공간을 얻는 방법이 더 낫습니까?
이것은 debian8 시스템입니다
root@blackoil:~# uname -a
Linux blackoil 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt7-1 (2015-03-01) x86_64 GNU/Linux
root@blackoil:~# dd if=/dev/zero of=e3fs bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 6.07722 s, 173 MB/s
root@blackoil:~# dd if=/dev/zero of=e4fs bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 6.21495 s, 169 MB/s
root@blackoil:~# losetup /dev/loop3 e3fs
root@blackoil:~# losetup /dev/loop4 e4fs
root@blackoil:~# mkfs.ext3 -m 0 /dev/loop3
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done
Creating filesystem with 256000 4k blocks and 64000 inodes
Filesystem UUID: 8871cd27-5c82-4fa9-acaa-11c2ca200d08
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
root@blackoil:~# mkfs.ext4 /dev/loop4
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: done
Creating filesystem with 256000 4k blocks and 64000 inodes
Filesystem UUID: 71b69de9-0858-4189-8e1f-907efd61f51d
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
root@blackoil:~# mkdir -p /mnt/e3
root@blackoil:~# mkdir -p /mnt/e4
root@blackoil:~# dumpe2fs /dev/loop3
dumpe2fs 1.42.12 (29-Aug-2014)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 8871cd27-5c82-4fa9-acaa-11c2ca200d08
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: 64000
Block count: 256000
Reserved block count: 0
Free blocks: 247557
Free inodes: 63989
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 62
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8000
Inode blocks per group: 500
Filesystem created: Mon Jul 20 15:21:53 2015
Last mount time: n/a
Last write time: Mon Jul 20 15:21:53 2015
Mount count: 0
Maximum mount count: -1
Last checked: Mon Jul 20 15:21:53 2015
Check interval: 0 (<none>)
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: a35b09fe-b755-49b6-a94d-eb8f2960e5a6
Journal backup: inode blocks
Journal features: (none)
Journal size: 16M
Journal length: 4096
Journal sequence: 0x00000001
Journal start: 0
root@blackoil:~# dumpe2fs /dev/loop4
dumpe2fs 1.42.12 (29-Aug-2014)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 71b69de9-0858-4189-8e1f-907efd61f51d
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 64000
Block count: 256000
Reserved block count: 12800
Free blocks: 247562
Free inodes: 63989
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 62
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8000
Inode blocks per group: 500
Flex block group size: 16
Filesystem created: Mon Jul 20 15:22:16 2015
Last mount time: n/a
Last write time: Mon Jul 20 15:22:16 2015
Mount count: 0
Maximum mount count: -1
Last checked: Mon Jul 20 15:22:16 2015
Check interval: 0 (<none>)
Lifetime writes: 16 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: 33846c93-9d1a-4117-a7c8-1566e96e8e73
Journal backup: inode blocks
Journal features: (none)
Journal size: 16M
Journal length: 4096
Journal sequence: 0x00000001
Journal start: 0
root@blackoil:~# mount /dev/loop3 /mnt/e3
root@blackoil:~# mount /dev/loop4 /mnt/e4
root@blackoil:~# rsync -a /usr/lib /mnt/e3
rsync: recv_generator: mkdir "/mnt/e3/lib/python2.6/xml/sax" failed: No space left on device (28)
*** Skipping any contents from this failed directory ***
rsync: write failed on "/mnt/e3/lib/python2.6/httplib.py": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]
root@blackoil:~# df |grep '/mnt/e'
/dev/loop3 991512 991512 0 100% /mnt/e3
/dev/loop4 991512 1264 922664 1% /mnt/e4
root@blackoil:~# cd /mnt/e3
root@blackoil:/mnt/e3# rsync -a . /mnt/e4
rsync: write failed on "/mnt/e4/lib/pepperflashplugin-nonfree/libpepflashplayer.so": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]
root@blackoil:/mnt/e3# df | grep '/mnt/e'
/dev/loop3 991512 991512 0 100% /mnt/e3
/dev/loop4 991512 959372 0 100% /mnt/e4
root@blackoil:/mnt/e3# df -i | grep '/mnt/e'
/dev/loop3 64000 8939 55061 14% /mnt/e3
/dev/loop4 64000 8531 55469 14% /mnt/e4
root@blackoil:/mnt/e3# rsync -av . /mnt/e4
sending incremental file list
lib/pepperflashplugin-nonfree/
lib/pepperflashplugin-nonfree/libpepflashplayer.so
lib/pepperflashplugin-nonfree/manifest.json
lib/pepperflashplugin-nonfree/pubkey-google.txt
lib/pkgconfig/dbus-python.pc
lib/pkgconfig/geoclue-2.0.pc
lib/pkgconfig/gnome-system-tools.pc
lib/pkgconfig/keybinder.pc
lib/pkgconfig/libgdiplus.pc
lib/pkgconfig/libquvi-scripts.pc
lib/pkgconfig/libwnck-1.0.pc
lib/pkgconfig/libxfce4menu-0.1.pc
lib/pkgconfig/libxklavier.pc
lib/pkgconfig/notify-python.pc
lib/pkgconfig/pm-utils.pc
lib/pkgconfig/tomboy-addins.pc
lib/pkgconfig/unique-1.0.pc
lib/pkgconfig/xkbcomp.pc
lib/pkgconfig/xorg-wacom.pc
lib/pm-utils/
( ...... some removed due to 30000 lines limit posting question)
rsync: write failed on "/mnt/e4/lib/pepperflashplugin-nonfree/libpepflashplayer.so": No space left on device (28)
rsync error: error in file IO (code 11) at receiver.c(393) [receiver=3.1.1]
root@blackoil:/mnt/e3# df |grep 'mnt/e'
/dev/loop3 991512 991512 0 100% /mnt/e3
/dev/loop4 991512 959372 0 100% /mnt/e4
root@blackoil:/mnt/e3# ls -l /mnt/e4/lib/pepperflashplugin-nonfree/libpepflashplayer.so
ls: cannot access /mnt/e4/lib/pepperflashplugin-nonfree
/libpepflashplayer.so: No such file or directory
root@blackoil:/mnt/e3# ls -l lib/pepperflashplugin-nonfree/libpepflashplayer.so
-rw-r--r-- 1 root root 17370752 Mar 14 09:08 lib/pepperflashplugin-nonfree/libpepflashplayer.so
root@blackoil:/mnt/e3# mount |grep 'mnt/e'
/dev/loop3 on /mnt/e3 type ext3 (rw,relatime,data=ordered)
/dev/loop4 on /mnt/e4 type ext4 (rw,relatime,data=ordered)
답변1
이는 귀하의 예비 블록 수에 있습니다:
ext3: 블록 수: 256000 예약된 블록 수: 0
ext4: 블록 수: 256000 예약된 블록 수: 12800
수정: #tune2fs -m 0 e4fs