[Linux] tar: /path/to/filename.bz2: Wrote only 4096 of 10240 bytes
[root@test ~]# tar jcpfP /path/to/filename.bz2 /path/to/directory/*
/bin/sh: line 1: bzip2: command not found
tar: /path/to/filename.bz2: Wrote only 4096 of 10240 bytes
tar: Child returned status 127
tar: Error is not recoverable: exiting now
"Wrote only 4096 of 10240 bytes"는 파일 압축이 제대로 되지 않았음을 뜻할 수 있다. 이 경우에는 bzip2 프로그램이 깔리지 않아서 tar 파일을 압축한 bz2 파일이 제대로 만들어지지 않는다. (bz2 파일의 크기가 0)
bzip2 프로그램을 깔고 다시 tar 명령을 다시 실행한다. (아래는 CentOS/RHEL 9에서 dnf로 bzip2을 설치하는 모습)
[root@test ~]# dnf install bzip2
Last metadata expiration check: 0:07:12 ago on Mon 08 Jan 2024 07:22:39 AM UTC.
Dependencies resolved.
=====================================================================================
Package Architecture Version
=====================================================================================
Installing:
bzip2 x86_64 1.0.8-8.el9
Transaction Summary
=====================================================================================
Install 1 Package
Total download size: 56 k
Installed size: 94 k
Is this ok [y/N]: n
Operation aborted.
[root@test ~]# dnf install bzip2
Last metadata expiration check: 0:07:41 ago on Mon 08 Jan 2024 07:22:39 AM UTC.
Dependencies resolved.
=====================================================================================
Package Architecture Version Repository Size
=====================================================================================
Installing:
bzip2 x86_64 1.0.8-8.el9 baseos 56 k
Transaction Summary
=====================================================================================
Install 1 Package
Total download size: 56 k
Installed size: 94 k
Is this ok [y/N]: y
Downloading Packages:
bzip2-1.0.8-8.el9.x86_64.rpm 449 kB/s | 56 kB 00:00
-------------------------------------------------------------------------------------
Total 222 kB/s | 56 kB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : bzip2-1.0.8-8.el9.x86_64 1/1
Running scriptlet: bzip2-1.0.8-8.el9.x86_64 1/1
Verifying : bzip2-1.0.8-8.el9.x86_64 1/1
Installed:
bzip2-1.0.8-8.el9.x86_64
Complete!
덧글을 달아 주세요