هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
fallocate -l 1G FILE creates a 1 GiB file in a moment: the file system reserves the blocks without writing zeros. Great for test files and disk-full tests. Other modes remove ranges (punch holes) or find and free zero blocks (-d).
طريقة الكتابة
fallocate [-c|-p|-z] [-o OFFSET] -l LENGTH [-n] FILE
fallocate -d [-o OFFSET] [-l LENGTH] FILE
fallocate -x [-o OFFSET] -l LENGTH FILEالخيارات 12
الأكثر استخدامًا
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Create a 1 GiB file at once
fallocate -l 1G /var/tmp/test.img ls -lh /var/tmp/test.imgDone in milliseconds.
2Fill a disk for a test
fallocate -l 9G /data/fillTest alerts and app behaviour on a full disk; delete it after.
3Make a sparse file smaller on disk
fallocate -d disk.imgZero blocks are freed (VM images, backups).
4Free a range in a log file
fallocate -p -o 0 -l 100M big.logThe file keeps its size, uses less disk.
5Reserve space without changing the size
fallocate -n -l 500M db.datSpace is reserved for later writes.
6Compare used and visible size
After -d the real use is smaller.
7Swap file (careful)
fallocate -l 1G /swapfileWorks on many file systems, but swapon may refuse it; dd is the safe way.
8Test file for upload limits
fallocate -l 101M /tmp/too-big.binTest a 100 MB upload limit of a web app.
9Truncate is different
truncate -s 1G sparse.imgtruncate makes a sparse file (no blocks reserved).
10Check quota limits
fallocate -l 2G ~/quota-testFails with "Disk quota exceeded" when the limit is lower.
لا يوجد شيء يطابق هذا الفلتر.
رموز الخروج
0 | Done. |
1 | Error. |