Am Dienstag 20 Juli 2010 schrieb Halim Sahin:
> huhu,
Hallo,
> Ich benötige auf der shell eine möglichkeit, eine datei anzulegen und
> ihre größe beim anlegen festzusetzen.
> also will noch nicht reinschreiben, aber sie soll dennoch 10G groß
> sein. Hab da zuerst an dd gedacht, aber das komplette beschreiben
> dauert mir einfach zu lang.
> Hat Jemand von euch für mich einen Tip?
fallocate, falls Kernel-Version, Dateisystem und Userspace mitspielen:
martin@shambhala:~/Zeit> df -hT /home
Dateisystem Typ Size Used Avail Use% Eingehängt auf
/dev/mapper/shambhala-home
ext4 197G 142G 54G 73% /home
martin@shambhala:~/Zeit> time fallocate -l 10g 10g
fallocate -l 10g 10g 0,00s user 0,03s system 16% cpu 0,168 total
martin@shambhala:~/Zeit> df -hT /home
Dateisystem Typ Size Used Avail Use% Eingehängt auf
/dev/mapper/shambhala-home
ext4 197G 152G 44G 78% /home
martin@shambhala:~/Zeit> time rm 10g
rm 10g 0,00s user 0,32s system 63% cpu 0,507 total
martin@shambhala:~/Zeit> df -hT /home
Dateisystem Typ Size Used Avail Use% Eingehängt auf
/dev/mapper/shambhala-home
ext4 197G 142G 54G 73% /home
martin@shambhala:~/Zeit> uname -a
Linux shambhala 2.6.33.6-tp42-toi-3.1.1.1-04982-g768d8a0 #4 PREEMPT Mon
Jul 12 21:19:10 CEST 2010 i686 GNU/Linux
Und Debian Squeeze / Sid-Userspace.
Ciao,
--
Martin 'Helios' Steigerwald - http://www.Lichtvoll.de
GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7
Attachment:
signature.asc
Description: This is a digitally signed message part.