bash: /bin/rm: Argument list too long

I came across this error when trying to delete lots of files on Debian Squeeze. This error apparently occurs due to the reason that the system commands show limitations when a large number of arguments are fed into a single command.
 
so I created a bash script called bulkrm containing
 
for i in *; do
rm -f $i;
done
chmod +x bulkrm
../bulkrm
 
(WARNING THIS WILL DELETE ALL FILES IN THE FOLDER IT'S EXECUTED FROM SO USE
AT YOUR PERIL)
 
Continue Reading

NAS down! NAS down!

My home nas has decided to die for the second time, good job I keep a cold spare. I've swapped the drives over and the raid is currently rebuilding. I am now on my third shuttle so thinking I will replace it with a HP N54L Microserver and be done with it, just need to wait for one of their cashback offers to crop up then I'll buy one.
Continue Reading

Resetting user and root password on raspberry pi

I hadn't used my pi for a while and when I did I found that I had changed the pi user password from the predfined 'raspberry' one. I did a bit of searching and found a method that work so thought i'd share.

Remove the SD card from your pi and insert into a card read attached to a windows machine.
After being detected a new drive should show up under My Computer called 'boot'
Open this drive and open the file cmdline.txt
This is a single line file and should look somethinig like this

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait

Now what you need to do is add init=/bin/sh to the end of it so it looks like this

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait init=/bin/sh

Save and close and reinsert the card into your pi. Now you'll need a KVM attached to your pi for the next bit, power up the pi and you'll notice early on in the boot process it stops and returns a bash prompt character #

From here enter the following
 

mount -o remount,rw /
passwd pi
(enter a new password)
sync
exec /sbin/init

You can also change the root user password at the same time if you have enabled that user, just use passwd root

After executing the final command your pi will boot normally and you will be able to login using the credentials you set. The final stage is to open /boot/cmdline.txt file and remove init=/bin/sh form the end, on your next reboot the pi will go through the boot process normally.

Continue Reading

Decisions Decisions

As per one of my earlier posts i'm looking to upgrade the drives in my home server. I've been looking into how I go about doing this from a Debian point of view and it seems like a bit of a mission, I would have to manually fail a drive, insert new one partition copy data across etc also i'm wondering how long 2tb is actually going to last me, remember this is the server for all the family so at some point I can see storage requirements expanding beyond thsi. 

At the moment i'm looking at the HP G7 N54L Microserver which although advertised as supporting 8GB memory and 4x2TB drivers people have reported running them on 16Gb memory and 4TB drives plus it supports hardware raid.
The trouble is doing all this will cost about £400 which is a hell of a lot of money BUT will this be cheaper than upgrading 1TB avery couple of years?
Continue Reading