bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

filesizes/diskusage with ls, du, df only on xen-images (fwd)


From: tstaps
Subject: filesizes/diskusage with ls, du, df only on xen-images (fwd)
Date: Wed, 16 Jul 2008 19:13:51 +0200 (CEST)
User-agent: Alpine 1.10 (LRH 962 2008-03-14)



---------- Forwarded message ----------
Date: Wed, 16 Jul 2008 19:13:04 +0200 (CEST)
From: tstaps <address@hidden>
To: address@hidden
Subject: filesizes/diskusage with ls, du, df only on xen-images

Hallo!

I have a problem, that is testet only on one machine.

I've created an filesystem with 5G:
address@hidden ~]# lvcreate -L 5G -n lv_opt_image1 vg_opt
Logical volume "lv_opt_image1" created
address@hidden ~]# mke2fs -j /dev/vg_opt/lv_opt_image1
mke2fs 1.39 (29-May-2006)
....
address@hidden ~]# tune2fs -c0 -i0 /dev/vg_opt/lv_opt_image1
address@hidden ~]# mkdir /opt/image1
address@hidden ~]# mount /dev/vg_opt/lv_opt_image1 /opt/image1
address@hidden ~]# cd /opt/image1
address@hidden image1]# df -k .
Dateisystem 1K-Blöcke Benutzt Verfügbar Ben% Eingehängt auf
/dev/mapper/vg_opt-lv_opt_image1
5160576 141440 4756992 3% /opt/image1
address@hidden image1]#

correct

(the image I used, was created as a disk with 2GB size)

address@hidden image1]# cp /var/lib/xen/images/xc51small.hda .
address@hidden image1]# file xc51small.hda
xc51small.hda: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 sectors; partition 2: ID=0x8e, starthead 0, startsector 208845, 3984120 sectors, code offset 0x48
address@hidden image1]# df -k .
Dateisystem 1K-Blöcke Benutzt Verfügbar Ben% Eingehängt auf
/dev/mapper/vg_opt-lv_opt_image1
5160576 1087236 3811196 23% /opt/image1
^^^^^^^ ?
address@hidden image1]# ls -l
insgesamt 945812
drwx------ 2 root root 16384 16. Jul 17:52 lost+found
-rwxr-xr-x 1 root root 2147483649 16. Jul 17:55 xc51small.hda
address@hidden image1]# du -k xc51small.hda
945796 xc51small.hda ?
address@hidden image1]# du -b xc51small.hda
2147483649 xc51small.hda

Other way: I will change the filetype:

address@hidden image1]# dd if=/dev/zero of=dummy bs=1k count=1
1+0 Datensätze ein
1+0 Datensätze aus
1024 Bytes (1,0 kB) kopiert, 3,3e-05 Sekunden, 31,0 MB/s

address@hidden image1]# cat xc51small.hda >> dummy

address@hidden image1]# file xc51small.hda dummy
xc51small.hda: x86 boot sector; partition 1: ID=0x83, active, starthead 1, startsector 63, 208782 sectors; partition 2: ID=0x8e, starthead 0, startsector 208845, 3984120 sectors, code offset 0x48
dummy: data

address@hidden image1]# ls -l
insgesamt 3045020
-rw-r--r-- 1 root root 2147484673 16. Jul 18:00 dummy
drwx------ 2 root root 16384 16. Jul 17:52 lost+found
-rwxr-xr-x 1 root root 2147483649 16. Jul 17:55 xc51small.hda

address@hidden image1]# du -k BOINC Desktop Mail basis bin daten dead.letter 
druck firefox handbuch.pdf ldap libjavaplugin_oji.so lost+found mail privat 
prog raeume rep.txt tmp tmp1 tmp2 vmw vmw.sh vmware
2099208 dummy
16 lost+found
945796 xc51small.hda

address@hidden image1]# du -b BOINC Desktop Mail basis bin daten dead.letter 
druck firefox handbuch.pdf ldap libjavaplugin_oji.so lost+found mail privat 
prog raeume rep.txt tmp tmp1 tmp2 vmw vmw.sh vmware
2147484673 dummy
16384 lost+found
2147483649 xc51small.hda

address@hidden image1]# df -k .
Dateisystem 1K-Blöcke Benutzt Verfügbar Ben% Eingehängt auf
/dev/mapper/vg_opt-lv_opt_image1
5160576 3186444 1711988 66% /opt/image1

it seems, that the original image only need round about 1GB


Next way: df shows low use, also can I copy?

address@hidden image1]# rm dummy
address@hidden image1]# ll
insgesamt 945812
drwx------ 2 root root 16384 16. Jul 17:52 lost+found
-rwxr-xr-x 1 root root 2147483649 16. Jul 17:55 xc51small.hda
address@hidden image1]# for D in 1 2 3 4 ; do cp xc51small.hda xc51small.hda$D ; done
address@hidden image1]# echo $?
0
address@hidden image1]# du -b
16384 ./lost+found
10737438725 .
address@hidden image1]# du -b BOINC Desktop Mail basis bin daten dead.letter 
druck firefox handbuch.pdf ldap libjavaplugin_oji.so lost+found mail privat 
prog raeume rep.txt tmp tmp1 tmp2 vmw vmw.sh vmware
16384 lost+found
2147483649 xc51small.hda
2147483649 xc51small.hda1
2147483649 xc51small.hda2
2147483649 xc51small.hda3
2147483649 xc51small.hda4
address@hidden image1]# du -k BOINC Desktop Mail basis bin daten dead.letter 
druck firefox handbuch.pdf ldap libjavaplugin_oji.so lost+found mail privat 
prog raeume rep.txt tmp tmp1 tmp2 vmw vmw.sh vmware
16 lost+found
945796 xc51small.hda
945796 xc51small.hda1
945796 xc51small.hda2
945796 xc51small.hda3
945796 xc51small.hda4
address@hidden image1]# df -k .
Dateisystem 1K-Blöcke Benutzt Verfügbar Ben% Eingehängt auf
/dev/mapper/vg_opt-lv_opt_image1
5160576 4870420 28012 100% /opt/image1
address@hidden image1]# ls -l
insgesamt 4728996
drwx------ 2 root root 16384 16. Jul 17:52 lost+found
-rwxr-xr-x 1 root root 2147483649 16. Jul 17:55 xc51small.hda
-rwxr-xr-x 1 root root 2147483649 16. Jul 18:04 xc51small.hda1
-rwxr-xr-x 1 root root 2147483649 16. Jul 18:05 xc51small.hda2
-rwxr-xr-x 1 root root 2147483649 16. Jul 18:05 xc51small.hda3
-rwxr-xr-x 1 root root 2147483649 16. Jul 18:06 xc51small.hda4

there are now 5 files with 2G each in one 5G filesystem.... I don't no why...
I hope, you can help (possible not only) me!

Thanks for your work!

tstaps

reply via email to

[Prev in Thread] Current Thread [Next in Thread]