Buffalo NAS-Central Forums

Welcome to the Linkstation Wiki community
It is currently Thu Oct 23, 2014 4:43 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Thu Jan 06, 2011 9:22 am 
Offline
Newbie

Joined: Wed Jan 14, 2009 11:21 pm
Posts: 23
I want to delete a load of files as I am running close to the 1TB capacity.

1folder is a folder I recovered from a corrupt disk and it is 30GB and has 50,000, mainly small, files in it. I started the delete and it said 8 hours!! :shock: ...so I left it over night to find that now it says 2 days!!!!

Tried a few times and it just won't go away, I don;t want my PC running for ages deleting this folder....and I assume it will then be in the Trashbox and I have to do this again.

I have noticed deletes and moves often fail or take time on the Linkstation, but this is taking the biscuit!!

Any ideas?


Top
 Profile  
 
PostPosted: Thu Jan 06, 2011 9:33 am 
Offline
Moderator

Joined: Fri Jun 29, 2007 10:39 am
Posts: 2596
Telnet to the box and change directory to /mnt/disk1 (resp. /mnt/array1).
Then change to the directory which contains your obsolete files and use
"rm" to remove them.
Search for "man rm" if you don't know how to use rm.

_________________
Please do not use private mail (PN/M) to ask questions. Use the proper forum instead. (me)

If there is no verified backup of a dataset, the dataset, by definition, is unimportant. (c't 2012)

RAID (no matter which level) never ever substitutes a backup. (me)


Top
 Profile  
 
PostPosted: Thu Jan 06, 2011 10:55 am 
Offline
Newbie

Joined: Wed Jan 14, 2009 11:21 pm
Posts: 23
thank you. I will do a search for that as I don't know what that is.

Will post back with results.


Top
 Profile  
 
PostPosted: Thu Jan 06, 2011 7:30 pm 
Offline
Newbie

Joined: Wed Jan 14, 2009 11:21 pm
Posts: 23
that looks quite complicated!


Top
 Profile  
 
PostPosted: Thu Jan 06, 2011 10:08 pm 
Offline
Newbie

Joined: Wed Jan 14, 2009 11:21 pm
Posts: 23
I don't think I have the know how to start doing all that stuff....can't beleive it take hours to delete small files in large numbers from the standard browsing interface.

Trying to do folder at a time and one folder less than 1GB is taking 15 minutes because it has a lot of files.....that's the first one !


Top
 Profile  
 
PostPosted: Fri Jan 07, 2011 12:03 am 
Offline
Regular Member

Joined: Sun Nov 04, 2007 9:39 pm
Posts: 158
Why don't you switch off the Trashbox for that folder? Go to the web admin page, Shared Folders, click on the folder you are trying to delete the files from and set Recycle Bin to Disable. It might speed things up a bit and at least you won't have to repeat the deletes to empty the trashbox folder.

PB


Top
 Profile  
 
PostPosted: Fri Jan 07, 2011 9:47 am 
Offline
Newbie

Joined: Wed Jan 14, 2009 11:21 pm
Posts: 23
PeeBee - thanks for that advice, I will run through all of that and hope it helps :)


Top
 Profile  
 
PostPosted: Fri Jan 14, 2011 6:53 pm 
Offline
Newbie

Joined: Wed Jan 14, 2009 11:21 pm
Posts: 23
removed trashbox...but to delete 11.1GB of files it is going to take 3 days and 15 hours!!!!!


Top
 Profile  
 
PostPosted: Fri Jan 14, 2011 11:29 pm 
Offline
Regular Member

Joined: Sun Nov 04, 2007 9:39 pm
Posts: 158
How about logging in to the web admin page, Shared Folders, select the share to be deleted and press the Delete button at the bottom of the page? Or is that how you are trying at the moment?

What do you mean by "standard browsing interface"? If you are trying via a Windows Explorer window from your PC then it will be slow as every delete is sent as an SMB (a network storage protocol) instruction from the PC to the NAS - the quickest way is definitely to telnet into the NAS and use rm as suggested earlier.

PB


Top
 Profile  
 
PostPosted: Fri Apr 15, 2011 9:13 pm 
Offline
Total Newbie

Joined: Fri Apr 15, 2011 7:57 pm
Posts: 1
I researched how to do this for a long time. I too had a trashbox that was filled with multiple backup copies of files and it filled up my 1 terabyte linkstation (I only had 36GB free). I tried the Web Admin for the Buffalo, that didn't work well at all, but I did turn off the option for keeping multiple copies of files to prevent this from happening again. Even through Web Admin, I was still taking several minutes per file to delete - (it would have taken years). I also read some advice in another thread about checking your connection speed to the drive - no help there either. But I found a solution and it only took a couple hours. I now have over 750GB free again. Here's what I did:

1: Being an old timer, I decided to use DOS and I pulled up the command prompt on my Vista machine. (You can find it under 'Accessories'.)
2: I navigated to my NAS by first making sure the drive was online and then typing "l:". That took me straight to Drive L (the letter of my NAS). My command prompt looked like this "L:\>"
3: I pulled up a directory by typing "dir" and saw that my trashbox folder (directory is the DOS term for folder) was in the root directory.
4: I navigated to my Trashbox folder by typing "cd trashbox". My command prompt looked like this "L:\trashbox>"
5: I then deleted all the files in my trashbox. Now, BEFORE you try this, I take no responsibility for whatever happens. I KNEW that I didn't need anything in the trashbox so I was fine with deleting the files - all of my files were old and all of my computers were being backed up into other folders. So here's what I typed, "del /s /q *.*" What this does is delete (del) every file (*.*) in the current folder and every subfolder (/s) and it does it quietly (/q) without asking you "are you sure? y/n" after every file. This means that once you hit enter, every file in every folder in the trashbox folder will be deleted with no second chance to bail out. I saw the filenames flying by on the screen as they were being deleted. No pretty colors, no cute graphics of papers entering a trash can, just a simple blur of text with the sound of a churning drive in the background. Wonderful! (Feel free to Google 'DOS Commands' to verify what works on your operating system.)
6: I went and ate dinner
7: I came back and found that approximately 725 Gigs of old files were gone in just a few hours (I don't know exactly how long it took because it was already complete upon my return.)
8: I went into Windows explorer and checked the properties of the drive to see how much free space I had created, I smiled, and then I deleted the empty folders from the trashbox. Problem solved.

I don't know if it will work for you, but it sure did for me.
Maybe all those days on the TRS-80 wasn't such a waste of time.

Cheers,
Wayne


Top
 Profile  
 
PostPosted: Mon May 02, 2011 12:41 am 
Offline
Newbie

Joined: Mon May 02, 2011 12:29 am
Posts: 6
silvercue wrote:
that looks quite complicated!


The complicated part in opening your box to ssh access is finding a proper set of instructions that works for your model, but it's well worth it.

Anyway, as said your issue is each file has to be deleted one by one by your OS when you ask him to delete a folder.
That incurs requests and replies from your OS to the box *for each file*, thus is very slow.

Only solution to avoid this overhead is to make the deletion command originate from the box itself, and without opening the box to ssh, the only way is the "Delete Share" button in the web admin interface.
If you do have files you want to keep on that share, then :
1. create a new shared folder, say 'tmp', to use with sftp
2. enable sftp for all shared folders from which you want to delete fodlers / files
3. download and use WinSCP to connect to the NAS
4. find each folder you want deleted, right click, 'move to', then select the tmp folder as destination. This operation will be instantaneous
5. when all folders are moved to the tmp share, connect to the admin web, and click 'delete share'

the web interface takes a few seconds to report 'Done', but you can hear the NAS work for much longer - minutes or at worst hours, but definitely not days.

HTH !

_________________
LS-WVL fw1.42 opened and ipkg-enabled


Top
 Profile  
 
PostPosted: Wed Jun 06, 2012 12:54 am 
Offline
Newbie

Joined: Tue Jun 05, 2012 11:39 pm
Posts: 9
Old thread but this comes up in google so I put in my contribution anyways.

Everyone always seems to want to DELETE or DISABLE transhbox from linkstation boxes. To me it seems it's essentially a good idea but the implementation is so-so. I do understand stuff actually gets deleted automagically from trashbox when you run out of free space. That's not really optimal, thought.

Since I have root, I just made a simple cron.d script to wipe out older than > 14 days files from the trashbox:

Code:
root@NAS:/mnt/disk1/tmp# cat /etc/cron/cron.d/purge_trash.sh
#!/bin/bash
#delete old junk from trashbox
find /mnt/disk1/Sharename/trashbox/* -mtime +14 -exec rm -rf '{}' \;


Top
 Profile  
 
PostPosted: Thu Mar 14, 2013 1:48 am 
Offline
Newbie

Joined: Tue Jun 05, 2012 11:39 pm
Posts: 9
And for the sake of completeness, here's the corresponding line for /etc/cron/crontabs/root
09 00 * * * * /etc/cron/cron.d/purge_trash.sh


Top
 Profile  
 
PostPosted: Thu Mar 14, 2013 9:09 am 
Offline
Regular Member

Joined: Mon Apr 26, 2010 10:24 am
Posts: 1868
Nice, thank you.
Can you modify the script, that it searches for trashbox on /mnt and on the founds it runs your script?


Top
 Profile  
 
PostPosted: Thu Mar 14, 2013 8:22 pm 
Offline
Newbie

Joined: Tue Jun 05, 2012 11:39 pm
Posts: 9
Hmh. This is the kind of script that can cause a lot of tears if something goes wrong.. Shell scripts not being my bread and butter exactly. Explicit path makes it less likely to go on a rampage. :down:

Anyways, if you feel brave, here's my best shot:
Code:
#!/bin/bash
#delete old junk from trashbox
TRASH=$(find /mnt -name trashbox -maxdepth 3)
if [ $TRASH ]
then
#       echo .$TRASH.
        find $TRASH/* -mtime +14 -exec rm -rf '{}' \;
fi


I have tested it with rm -ri and as far as I can tell, it works as advertised. If there is "trashbox", it gets processed, if not, then not. Obviously this works for any directory name.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Protected by Anti-Spam ACP
Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group