DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-02-11 11:50:00

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Deleting big files - system dead during it

I have found EXT2 system problem in dns-323.
I am storing sat streams to dns323 to big files (max 16G). It lets me store many hours to 1 file. The problem is when I am deleting the file from the disc. It looks like each 1G of data needs 0.7s for be removed from disc. During this process the disc is not doing anything else. I can not read nothing and (have to check) can not write. If I am removing 16G file I have system dead for 10 seconds !!!!
How can I fix this problem ?
Why d-link has changed EXT3 to EXT2 ?

Offline

 

#2 2008-02-11 12:54:43

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: Deleting big files - system dead during it

When you delete a file you're not actually touching the 16gb data at all, you're just removing the inodes that point to the blocks where the data resides on the disk. IIRC, files with 12 or less blocks of data will be accessed the fastest, then you start moving in to indirect blocks (inode poiting to a block of pointers which point to data blocks), and then double & triple indirect blocks. I can't remember what happens to the indirect blocks when you remove a file - I would have thought that removing the primary inode would be sufficient but maybe I am wrong and this is why it's taking so long.

If you wanted to speed things up when using large files, increasing the block size used on the file system would probably help as it would reduce the number of indirect blocks used. However, I believe this would have to be done when you format the disk (i.e: you'd need a reformat!).

Offline

 

#3 2008-02-11 15:49:28

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

I think , the max size of block in EXT2 is 4096 bytes. It will not help much.
Is the formating from hand safe operation ? The standard formating is initiated by www interface of dns323 soft. If I will do it in other way , I can omit  something necessary for correct working of this device, I afraid.

Last edited by Tom0000 (2008-02-11 15:52:22)

Offline

 

#4 2008-02-11 16:15:45

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: Deleting big files - system dead during it

Yes, 4kb is max (although 8kb for alpha I think). Re: formatting on the dns-323 - I'm not sure if it's safe or not to be honest, most of the web based functions are all binary so you can't really see what they're doing. Specifically I haven't looked to see how the dns-323 checks if the filesystem is "ok", I would've though that formatting /dev/md0 should be fine in terms of the dns-323 still recognizing the mirror (if that's what you're using) but I wouldn't guarantee it. Reformatting is also a bit of a drastic step without investigating first.

How are you deleting the file? Via samba? ftp? telnet? It could be a problem with samba etc... I'll create a 16gb file on my dns-323 now and delete it via telnet to see how long it takes...

Offline

 

#5 2008-02-11 17:04:49

HaydnH
Member
Registered: 2007-09-28
Posts: 187

Re: Deleting big files - system dead during it

Deleting 16G on my box takes 27 seconds, but the system is still completely usable while it's doing it. Perhaps it's a samba issue or perhaps you have a failing disk in a mirror or something that requires cpu power (it's software raid after all).

Note: Interesting to see the built-in ls commands -h flag is broken and shows "0" instead of 16G! It shows correctly without the "-h".

Code:

/mnt/HD_a2/tmp # /mnt/HD_a2/fun_plug.d/bin/dd if=/dev/zero of=./largeFile.tmp bs=1M count=16384
16384+0 records in
16384+0 records out
/mnt/HD_a2/tmp #
/mnt/HD_a2/tmp #
/mnt/HD_a2/tmp # ls -lh largeFile.tmp
-rw-r--r--    1 root     root            0 Feb 11 14:55 largeFile.tmp
/mnt/HD_a2/tmp #
/mnt/HD_a2/tmp #
/mnt/HD_a2/tmp # /mnt/HD_a2/fun_plug.d/bin/ls -lh largeFile.tmp
-rw-r--r--    1 root     root        16.0G Feb 11 14:55 largeFile.tmp
/mnt/HD_a2/tmp #
/mnt/HD_a2/tmp #
/mnt/HD_a2/tmp # /mnt/HD_a2/fun_plug.d/bin/time rm -f largeFile.tmp &
/mnt/HD_a2/tmp # ls -l
-rwxr--r--    1 root     root          903 Feb  7 15:04 install.sh
-rwxrwxrwx    1 haydn    users      140452 Feb  8 13:21 lighttpd
-rwxrwxrwx    1 haydn    users     1943936 Feb  8 12:56 php-cgi
-rwxrwxrwx    1 haydn    users       48638 Feb  8 12:54 php.ini
-rwxr--r--    1 root     root          231 Feb  7 16:01 test.sh
/mnt/HD_a2/tmp # 
/mnt/HD_a2/tmp # 
/mnt/HD_a2/tmp # ps -ef |grep time
 3514 root        240 S   /mnt/HD_a2/fun_plug.d/bin/time rm -f largeFile.tmp 
 3518 root        244 S   grep time 
/mnt/HD_a2/tmp # 
/mnt/HD_a2/tmp # real        0m 26.53s
user    0m 0.00s
sys     0m 1.39s

Offline

 

#6 2008-02-11 21:59:26

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

I can delete with this problem over samba and after login by telnet. The problem is with working my devices with samba connection.
I am using dremboxes as recorders. I have tried to use nfs, but it is useless in dns323. I can record only as no_root_squash , else the data files are created in 0 lenght . All files are created with root owning and I am not able to delete it during data editing on pc in windows (samba).
Next is not existing free dns client for windows except buggy (very buggy ) unix tools for win. It makes me using only samba.

Offline

 

#7 2008-02-19 15:20:31

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

Two samba connections from Windows to DNS-323. Each one to separate disc in DNS.
If I am deleting big file in totalcomander on first disc in DNS and at the same time I am playing the recorded material from the second disc in DNS, the playing is freezing for time needed for finish deleting from first disc .

What can I do for been able to use DNS during deleting big files ?

Offline

 

#8 2008-02-19 19:57:16

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Deleting big files - system dead during it

Firstly I would try to run e2fsck on the disks, secondly chechk which process is actually choking the computer.

If you have Seagate disks in your enclosure do not forget to remove the compatibility jumper that they ship with. See my next post.

Offline

 

#9 2008-02-19 21:20:20

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

If deleting file from one disk is stopping reading other file from second disc all over 2 samba connections , it can not be problem with file structure on the disk.
I am using seagate 1T (jumper removed) and samsung 500G .

Offline

 

#10 2008-02-19 23:06:21

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Deleting big files - system dead during it

Maybe Samba is running out of memory when you make concurrent requests? I have seen strange issues when opening some folders- there would be a massive amount of network activity and the computer appears to be frozen for 30 seconds... I am on a Gigabit network- would you see a lot of network activity between the workstation and the dlink box when deleting the files?

Offline

 

#11 2008-02-20 08:49:20

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

I can not answer now, but will check when I will return home.
The max utilization of network I have had during playing recorded ts files. The player has option to play every second when right key is pressed. When I pressing constant this key, I see movie with next frame every 1 seconds. In this mode it was 150Mbit and it was max in my net. But this never slowed my other connections to second and the same disk in DNS.

Offline

 

#12 2008-02-20 19:31:51

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

I have checked the the network activity during deleteing two files , each 8G length. It is small. Smaller than 0.1% of my bandwidth.

Offline

 

#13 2008-02-20 21:38:36

Tilly
Member
Registered: 2007-11-11
Posts: 139

Re: Deleting big files - system dead during it

Tom0000 wrote:

If deleting file from one disk is stopping reading other file from second disc all over 2 samba connections , it can not be problem with file structure on the disk.
I am using seagate 1T (jumper removed) and samsung 500G .

I use my DNS-323 also for the system images from different PCs. Most of them have sizes  > 14GB. To delete each of them take ~ 5 sec.

You should use HDDs which are compatibel with the DNS-323.

Offline

 

#14 2008-02-20 22:10:50

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Deleting big files - system dead during it

Maybe your ext2 is badly fragmented. I had once 89% fragmented ext3 and it was very slow plus has eaten all RAM for caching. And unlikely NTFS/FAT it does not get fixed by moving the files in and out. You have to reformat.
Fragmentation report can be obtained from e2fsck

You really want to break your issue down to basic elements and address each one separately to find out what is the problem:
1. Hard disk compatibility issue
2. Hardware fault
3. Disk fragmentation
4. Network communication problems
5. DNS-323 configuration issue

Offline

 

#15 2008-02-20 22:31:11

Tilly
Member
Registered: 2007-11-11
Posts: 139

Re: Deleting big files - system dead during it

skydreamer wrote:

Maybe your ext2 is badly fragmented. I had once 89% fragmented ext3 and it was very slow plus has eaten all RAM for caching. And unlikely NTFS/FAT it does not get fixed by moving the files in and out. You have to reformat.
Fragmentation report can be obtained from e2fsck

I use my DNS-323 since 6 month and i never used a tool like fsck.ext2!

Offline

 

#16 2008-02-21 00:22:53

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Deleting big files - system dead during it

skydreamer wrote:

Maybe your ext2 is badly fragmented. I had once 89% fragmented ext3 and it was very slow plus has eaten all RAM for caching. And unlikely NTFS/FAT it does not get fixed by moving the files in and out. You have to reformat.
Fragmentation report can be obtained from e2fsck

You really want to break your issue down to basic elements and address each one separately to find out what is the problem:
1. Hard disk compatibility issue
2. Hardware fault
3. Disk fragmentation
4. Network communication problems
5. DNS-323 configuration issue

I can't speak for efs(n) file systems, but fragmentation has very little impact on the deletion of large files on NTFS/FAT file systems - large numbers of files is of course different.

With NTFS/FAT essentially what happens is the directory entry pointing to the first block is deleted and the blocks are marked as available in the allocation table, I would assume the process is not significantly different with linux file systems.

Offline

 

#17 2008-02-24 01:16:57

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

Tilly
I have never heard about hard discs not compatible with linux. If you know one write it here.
If sata controller in DNS is not standard but is special only for some discs maybe you will write something about it ?

skydreamer
if my disc is badly fragmented after 2 weeks of formating it in DNS , the conclusion can be only one - ext and linux are shit and can not be used in any sense work. Did you wanted write this ?


I have written clear - when I am deleting big file on one disk I have freezing reading data from second disk.
Deleting is on the same PC on one samba link and playing is on the same PC on second samba link.
Sorry I can not check one on samba and second on nfs because I do not know free nfs client for windows and MS version is not working with my system. But if someone can suggest any not MS nfs client for windows I will check.

The problem has to be in the link.

Offline

 

#18 2008-02-24 02:15:41

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

e2fsck -n /dev/sda2
e2fsck 1.32 (09-Nov-2002)
/dev/sda2 was not cleanly unmounted, check forced.
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Free blocks count wrong (51034071, counted=49474309).
Fix? no
Free inodes count wrong (60927926, counted=60927865).
Fix? no
/dev/sda2: ********** WARNING: Filesystem still has errors **********


I have no idea what should do with it. If I have to fix, why the ext2 is using if it is not stable ?

Offline

 

#19 2008-02-25 02:35:36

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Deleting big files - system dead during it

Tom0000

I managed to reproduce your issue with slow deletion of large files- was backing up films from my Dreambox hard disk and since it did not work out had to delete them. The same thing- it took 45 seconds to delete 30 files in total 20 GBytes. They are transport stream .ts divided into chunks of 1 GByte.

If you want to fix the disk errors, you need to unmount it first, see my post with a modified funplug. The chances are that the FS errors have been dreamt up as the system was being used.

I was getting much better performance deleting files over nfs but it is 70% slower than samba for file transfer as it is using user space NFS daemon.

Offline

 

#20 2008-02-25 08:22:15

leftkidney
Member
Registered: 2007-12-26
Posts: 54

Re: Deleting big files - system dead during it

I have noticed this with deleting large files in Windows Explorer as well for years

it is not a new thing (atleast to me) to have wait while deleting large files before you can navigate to a different directory

Offline

 

#21 2008-02-25 11:59:48

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

leftkidney, ok if it will be on one disk, but why deleting file on 1 disk will stop reading file from second disk ?

Why is dlink stopping using journal in current firmware  ?
I have to check this :

dd if=/dev/zero of=/mnt/HD_a2/file bs=1M count=100000
mke2fs -j /mnt/HD_a2/file
mount /mnt/HD_a2/file /mnt/HD_a2/file_mount

and mount samba to new created device . Maybe it will help if I will delete files from device with journal.

skydreamer, deleting 10 x 1G is not the same like 1 x 10G. If you will delete 10 files the system will have free time (for system/user use) between deleting each file from this 10.

Have you tried use nfs for your dreambox ?
I have found 1 problem. 
If I am using no_root_squash in export , the dreambox is working fine. If I will use any other option the dreambox will write correct only eit file and all ts files will have 0 length.
The no_root_squash makes a problem for me, because each file created this way over nfs has root privillages and no way to delete anything over samba connection. Do you have any any idea for this problem fix ?

Last edited by Tom0000 (2008-02-25 12:28:52)

Offline

 

#22 2008-02-25 12:06:45

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Deleting big files - system dead during it

Tom0000 wrote:

The no_root_squash makes a problem for me, because each file created this way over nfs has root privillages and no way to delete anything over samba connection. Do you have any any idea for this problem fix ?

I don't have a PS3, but can't you tell the PS3 to use a different user/uid and group/gid over NFS?

Offline

 

#23 2008-02-25 12:28:00

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

fonz, if you will use no_root_squash all created files over nfs will wil have owner root . If you will change this option , owner will be nobody and this will let deleteing it over samba connection.

Offline

 

#24 2008-02-25 13:33:45

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Deleting big files - system dead during it

Tom0000 wrote:

Have you tried use nfs for your dreambox ?
I have found 1 problem. 
If I am using no_root_squash in export , the dreambox is working fine. If I will use any other option the dreambox will write correct only eit file and all ts files will have 0 length.
The no_root_squash makes a problem for me, because each file created this way over nfs has root privillages and no way to delete anything over samba connection. Do you have any any idea for this problem fix ?

I found nfs very slow especially when used with or from dreambox. The transfer rates I was getting were in the range of 500kB/s.
Samba is a much better option, with speeds 2,500 kB/s when launched from Dreambox and dlink is mounted there as cifs. It is even faster through a third PC having dlink and dreambox shares mounted there. The speed was 3,500 kB/s but it left out most files as it tripped over the international characters-  Dreambox assigns funny names to the films from Taquilla, Premiere or TPS.

Maybe you can try to run top when deleting the files to see what is the biggest drag on the d-link's CPU.

Offline

 

#25 2008-02-26 00:20:54

Tom0000
Member
Registered: 2008-01-31
Posts: 23

Re: Deleting big files - system dead during it

I have deleted 10G file. The Top has shown nothing during the deleting process.  The dream has played clip from the same disk over own samba connection. No freezing on dream.
Strange, the freezing is only on the same computer on which the deleting process is run.
One thing very good, this what I am doing on PC will not make any problems on dream, second thing very strange , why the windows xp prof with samba connection sees this problem.

Last edited by Tom0000 (2008-02-26 00:21:16)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB