BASH 스크립트로 UDF의 블록 장치 (하드 드라이브 또는 플래시 드라이브)를 포맷하십시오. 출력은 여러 운영 체제 패밀리 (Windows, MacOS 및 Linux)에서 읽기/쓰기에 사용할 수있는 드라이브입니다. 이 스크립트는 MacOS 또는 Linux에서 실행할 수 있어야합니다.
고급 사용자의 경우 형식 -UDF는 파티션 테이블을 수정하지 않고 단일 기존 파티션을 형식화 할 수 있습니다. 이 방법을 사용하면 새로 포맷 된 UDF 파티션을 MacOS에서 사용할 수 없지만 Linux 및 Windows에서도 사용할 수 있음을주의하십시오. (경고는 #24 참조)이 제한으로 인해 전체 장치를 포맷하는 것이 좋습니다.
형식 -UDF는 순진하게 형성된 UDF 장치가 다양한 운영 체제에서 작동하는 것을 방지하는 일부 OS 특이 적 퀴크를 해결하기 위해 만들어졌습니다. 다음은 Complicating 요소 중 일부가 다음과 같습니다.이 요소는 다음과 같습니다.이 요소는 다음과 같습니다.이 요소는 다음과 같습니다.
언뜻보기에, 이러한 제약은 부분적으로 갈등을 겪고있는 것으로 보인다. Pieter가 제안한 솔루션은 하나의 전체 디스크 파티션을 나열하는 드라이브의 첫 번째 블록에 가짜 파티션 테이블 (MBR을 통해)을 배치하는 것입니다. UDF (아마도 의도적으로)는 첫 번째 블록을 사용하지 않기 때문에 작동합니다. 불행히도,이 작업을 수행하는 쉬운 방법은 없었으며 (장치 논리 블록 크기와 같은 다른 모든 변수를 저글링합니다. Format-udf는 Windows의 추가 호환성을 위해 이와 같은 가짜 MBR을 작성합니다. 이것이 당신이 원하는 것이 아니라면 -p none 으로 mbr을 비활성화 할 수 있습니다.
이 프로젝트의 목표는 현대적인 기능을 갖춘 크로스 플랫폼 파일 시스템에 대한 액세스를 제공하는 것 입니다.
모든 운영 체제가 UDF를 지원하는 것은 아닙니다. 다음 테이블은 UDF에 대한 운영 체제 지원 세부 사항입니다. 데이터는 https://en.wikipedia.org/wiki/universal_disk_format#compatibility (2017-06-16에서 검색)에서 조정되었습니다.
아래에 나열되지 않는 한 두 읽기/쓰기 모두 지원됩니다.
| 운영 체제 | 읽기 전용 | 메모 |
|---|---|---|
| Windows XP, Server 2003 | 읽기 전용 | 타사 유틸리티와 함께 제공되는 지원을 작성하십시오 |
| Windows Vista, 7, 8, 10 | Microsoft에 의해 "라이브 파일 시스템"이라고합니다. 가짜 풀 디스크 파티션이 필요합니다 | |
| Mac OS 9 | ||
| Mac OS X 10.5 ~ 10.11 | ||
| MacOS 10.12+ | ||
| Linux 2.6+, 3.x | UDF 개정 2.01과 이전에 읽기/쓰기가 있습니다. UDF 개정 2.01 이후 읽기 전용. | |
| AIX 5.2, 5.3, 6.1 | ||
| Beos, Magnussoft Zeta, Haiku | ||
| 도스 박스 | ||
| ecomstation, OS/2 | OS/2의 추가 비용 드라이버 | |
| netbsd 5.0 | ||
| Solaris 8, 9, 10 |
| 운영 체제 | 메모 |
|---|---|
| Windows 95 OSR2+, 98 | 유틸리티에는 DLA 및 Incd가 포함됩니다 |
| Windows 2000, 나 |
| 운영 체제 | 메모 |
|---|---|
| DOS, Freedos, Windows 3.11 이상 | ISO9660 뒤로 호환성 구조가있는 파일 시스템을 읽을 수 있습니다. |
모든 운영 체제가 4K 드라이브 (고급 형식)를 지원하는 것은 아닙니다. 운영 체제가 4K 드라이브가 아닌 UDF를 지원하는 경우 Format-UDF를 사용하여 여전히 문제가 발생할 수 있습니다.
다음 테이블은 4K 드라이브의 Windows 지원을 자세히 설명합니다. 데이터는 Windows에서 4K 섹터 하드 드라이브에 대한 Microsoft 지원 정책에서 수정되었습니다 (2017-06-16에서 검색). 이 테이블에 겹쳐진 형식 -UDF 커뮤니티의 결과를 테스트합니다. (XP에서 테스트 한 @Pali에게 특별한 감사).
| 크기 / OS | 512 바이트 원주민 | 512 에뮬레이션 (일명 "512e") | 4K 네이티브 (일명 "4kn") |
|---|---|---|---|
| 논리적 블록 크기 | 512 바이트 | 512 바이트 | 4096 바이트 |
| 물리적 블록 크기 | 512 바이트 | 4096 바이트 | 4096 바이트 |
| 최대 UDF 파일 시스템 용량 | 2 TIB | 2 TIB | 16 티브 |
| Windows XP | 지원; 공장 | 지지되지 않은; 작동하지 않습니다 | 지지되지 않은; 작동하지 않습니다 |
| Windows XP Pro X64, 서버 2003, 서버 2003 R2 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원되지 않습니다 | 지원되지 않습니다 |
| Windows Vista, 서버 2008 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원되지 않습니다 |
| Windows 7, 서버 2008 R2 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원되지 않습니다 |
| Windows 8, 서버 2012 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 |
| Windows 8.1, 서버 2012 R2 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원되지 않습니다 | 지원되지 않습니다 |
| Windows 10, 서버 2016 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 | 지원되지 않습니다 | 지원; 아마도 효과가 있지만 테스트되지 않았습니다 |
테스트를 수행하고 Format-UDF의 향후 사용자에게 혜택을주기 위해이 테이블을 업데이트하려면 풀 요청을 보내십시오. 원시 데이터 또는 테스트 결과에 대한 링크를 포함하십시오.
printfxxdblockdev , ioregblockdev , diskutillsblk , diskutilumount , diskutilmkudffs , newfs_udf우분투에 필요한 전제 조건을 설치하려면 :
sudo apt-get install udftools coreutils vim-common
Format-UDF는 독립적 인 스크립트입니다. Format-udf.sh를 선택한 디렉토리로 복사하기 만하면됩니다. 실행 가능하게 만드는 것을 잊지 마십시오 :
chmod +x format-udf.sh
Bash script to format a block device (hard drive or Flash drive) in UDF.
The output is a drive that can be used for reading/writing across multiple
operating system families: Windows, macOS, and Linux.
This script should be capable of running in macOS or in Linux.
Usage: ./format-udf.sh [-b BLOCK_SIZE] [-f] [-p PARTITION_TYPE] [-w WIPE_METHOD] device label
./format-udf.sh -v
./format-udf.sh -h
-b BLOCK_SIZE
Block size to be used during format operation.
If absent, defaults to value reported by blockdev/diskutil.
This is an expert-only option. Please consult the README for details.
-f
Forces non-interactive mode. Useful for scripting.
Please use with caution, as no user confirmation is given.
-h
Display help information and exit.
-p PARTITION_TYPE
Partition type to set during format operation.
Currently supported types include: mbr, none
mbr - Master boot record (default)
none - Do not modify partitions
If absent, defaults to 'mbr'.
See also:
https://github.com/JElchison/format-udf#why
-v
Display version information and exit.
-w WIPE_METHOD
Wipe method to be used before format operation.
Currently supported types include: quick, zero, scrub
quick - Quick method (default)
zero - Write zeros to the entire device
scrub - Iteratively writes patterns on device
to make retrieving the data more difficult.
Requires 'scrub' to be executable and in the PATH.
See also http://linux.die.net/man/1/scrub
If absent, defaults to 'quick'.
Note: 'zero' and 'scrub' methods will take a long time.
device
Device to format. Examples:
* /dev/sdx (Linux, where 'x' is a letter) or
* /dev/diskN (macOS, where 'N' is a number)
label
Label to apply to formatted device.
Example: ./format-udf.sh /dev/sdg "My UDF External Drive"
우분투에서 :
user@computer:~$ ./format-udf.sh /dev/sdg "My UDF External Drive"
[+] Validating arguments...
[+] Testing dependencies...
[+] Looking for drive detail tool... using /sbin/blockdev
[+] Looking for drive listing tool... using /sbin/blockdev
[+] Looking for drive info tool... using /bin/lsblk
[+] Looking for drive summary tool... using /sbin/blkid
[+] Looking for unmount tool... using /bin/umount
[+] Looking for UDF tool... using /usr/sbin/mkudffs
[+] Detecting logical block size...
[sudo] password for user:
[*] Detected logical block size of 512
[+] Validating detected logical block size...
[+] Detecting physical block size...
[*] Detected physical block size of 512
[+] Validating detected physical block size...
[+] Validating file system block size...
[*] Using file system block size of 512
[+] Detecting total size...
[*] Detected total size of 8019509248
[+] Validating detected total size...
[+] Gathering drive information...
/dev/sdg: LABEL="Old Drive" UUID="4843-D1BD" TYPE="vfat"
RO RA SSZ BSZ StartSec Size Device
rw 256 512 512 0 8019509248 /dev/sdg
The above-listed device (and partitions, if any) will be completely erased.
Type 'yes' if this is what you intend: yes
[+] Unmounting device...
umount: /dev/sdg: not mounted
[+] Zeroing out first chunk of device...
4096+0 records in
4096+0 records out
2097152 bytes (2.1 MB, 2.0 MiB) copied, 0.450716 s, 4.7 MB/s
[+] Formatting /dev/sdg ...
filename=/dev/sdg
label=My UDF External Drive
uuid=5e4924cc17b50769
blocksize=512
blocks=15663104
udfrev=2.01
start=0, blocks=64, type=ERASE
start=64, blocks=13, type=VRS
start=77, blocks=19, type=ERASE
start=96, blocks=16, type=MVDS
start=112, blocks=16, type=ERASE
start=128, blocks=16, type=LVID
start=144, blocks=112, type=ERASE
start=256, blocks=1, type=ANCHOR
start=257, blocks=15662590, type=PSPACE
start=15662847, blocks=1, type=ANCHOR
start=15662848, blocks=96, type=ERASE
start=15662944, blocks=16, type=RVDS
start=15662960, blocks=143, type=ERASE
start=15663103, blocks=1, type=ANCHOR
[+] Writing fake MBR...
16+0 records in
16+0 records out
16 bytes copied, 0.0037039 s, 4.3 kB/s
2+0 records in
2+0 records out
2 bytes copied, 3.7193e-05 s, 53.8 kB/s
[+] Successfully formatted /dev/sdg: UUID="5e4924cc17b50769" LABEL="My UDF External Drive" TYPE="udf" PTTYPE="dos"
Please disconnect/reconnect your drive now.
MACOS :
computer:~ user$ ./format-udf.sh /dev/disk4 "My UDF External Drive"
[+] Validating arguments...
[+] Testing dependencies...
[+] Looking for drive detail tool... using /usr/sbin/ioreg
[+] Looking for drive listing tool... using /usr/sbin/diskutil
[+] Looking for drive info tool... using /usr/sbin/diskutil
[+] Looking for drive summary tool... using (none)
[+] Looking for unmount tool... using /usr/sbin/diskutil
[+] Looking for UDF tool... using /sbin/newfs_udf
[+] Detecting logical block size...
[*] Detected logical block size of 512
[+] Validating detected logical block size...
[+] Detecting physical block size...
[+] Validating file system block size...
[*] Using file system block size of 512
[+] Detecting total size...
[*] Detected total size of 8019509248
[+] Validating detected total size...
[+] Gathering drive information...
/dev/disk4 (external, physical):
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *8.0 GB disk4
1: Windows_FAT_32 Old Drive 8.0 GB disk4s1
The above-listed device (and partitions, if any) will be completely erased.
Type 'yes' if this is what you intend: yes
[+] Unmounting device...
Password:
Unmount of all volumes on disk4 was successful
[+] Zeroing out first chunk of device...
4096+0 records in
4096+0 records out
2097152 bytes transferred in 3.113956 secs (673469 bytes/sec)
[+] Formatting /dev/disk4 ...
write to block device: /dev/disk4 last written block address: 15663103
[+] Writing fake MBR...
16+0 records in
16+0 records out
16 bytes transferred in 0.000615 secs (26021 bytes/sec)
2+0 records in
2+0 records out
2 bytes transferred in 0.000644 secs (3106 bytes/sec)
[+] Successfully formatted
Please disconnect/reconnect your drive now.
형식 -UDF가 드라이브를 형식화 할 때 올바른 블록 크기를 사용하는 것이 매우 중요하다면. Format-UDF는 올바른 (논리적) 블록 크기를 감지하고 사용하려고 시도합니다. 당신이하고있는 일을 알고 있다면, 형식 -udf -b BLOCK_SIZE 옵션을 사용하여 감지 된 블록 크기 값을 명시 적으로 무시할 수 있습니다.
서식 중에 잘못된 블록 크기가 사용되는 경우 (즉, 드라이브의 논리적 블록 크기와 일치하지 않는) 결과 드라이브는 OS 호환성 문제가 있고 최적의 성능 문제가 발생할 수 있습니다.
같은 방식으로, 올바른 블록 크기를 사용하여 결과 드라이브를 장착하는 것이 중요합니다. 많은 운영 체제는 하나의 블록 크기 만 시도합니다 (일반적으로 마운트 유틸리티 기본값이 무엇이든). 예를 들어, UDF 장치를 장착하려면 Windows는 UDF 파일 시스템이 논리 블록 크기와 같은 블록 크기를 사용해야하는 것 같습니다. 블록 크기가 OS의 기본값이 아닌 경우 자동 장착은 OS에서 작동하지 않을 수 있습니다. 작은 성가신 반면 수동 장착 시도는 여전히 비표준 블록 크기에 성공해야합니다.
Linux에서 수동으로 마운트하는 방법의 예 :
$ mount -t udf -o bs=4096 /dev/sdX /mnt/mount-point
MacOS에 수동으로 마운트하는 방법의 예 :
$ sudo mount_udf -b 4096 /dev/diskN /Volumes/MountPoint
안타깝게도 블록 크기가 512와 다른 것은 Windows XP에서 마운트하지 않는 것 같습니다.
자세한 내용은 #12, #13, #16 및 #31을 참조하십시오.
UDF 형식의 최대 2^32 블록이 있습니다. 형식 -UDF를 사용하면이 블록은 논리적 블록과 동일합니다.
드라이브 에이 최대 크기를 초과하는 용량이 있으면 추가 용량이 사용되지 않습니다. 이것은 UDF 자체의 한계입니다.
최대 OS 호환성의 경우 논리적 블록 크기가 512 바이트 인 장치에서 형식 -UDF를 사용하십시오. 이렇게하면 총 용량을 2 TIB로 제한하지만 결과 장치는 가장 많은 운영 체제에서 작동해야합니다.
최대의 결과 UDF 파일 시스템 용량의 경우 논리적 블록 크기가 4096 바이트 인 장치에서 사용 형식 -UDF를 사용하십시오. 이렇게하면 총 용량 (2 TIB)에서 16 TIB로 증가하지만 결과 장치를 장착/읽기/쓸 수있는 운영 체제의 수/유형을 제한합니다. 자세한 내용은 위의 호환성 테이블을 참조하십시오.
사람이 읽을 수있는 장치 레이블의 경우 다음 구성 중 하나에서 Format-UDF를 사용하십시오.
fdisk 사용하여 BIOS가 파티션이없는 드라이브에서 부팅 할 수없는 경우 파티션을 활성으로 설정할 수 있습니다. (팁에 대한 @tome- 감사합니다.)