I've asked about this on forums.debian.net but have gotten no solution so far.
I installed Debian to my Dockstar using the Doozan script. It also has two 1 TB usb hard disks hooked to it.
The machine is used for only rtorrent and nfs. The flash drive contains only the system software and rtorrent. All of the data that rtorrent moves around is on the usb hard disks, including downloaded data, watch folder, and session folder. rtorrent is configured to not have a log file.
About once a day I run rsync with the source being one usb hard disk and the target being the other usb hard disk:
# rsync --progress --stats -a --delete /media/usb_1/ /media/usb_2
Since this machine boots from a usb flash drive, I'm interested in keeping the number of writes to the flash drive to a minimum.
The machine used to boot from an Adata flash drive, which has no LED. That drive wore out after about five months. Completely dead, as in gparted would fail with an I/O error on write when trying to write a new partition table to it. No big deal - I restored the software to a new flash drive using an image I had made in Clonezilla.
The new drive (a Sandisk Cruzer 4 GB) has an LED, and I assume this is showing me when the drive is being accessed, read and write. When the system is at idle, the LED sort of "breathes" off and on slowly. When rtorrent is downloading or uploading, it flashes a few times and goes back to breathing.
I'm assuming that once everything has been loaded and the system has been running a while, that when the LED flashes, that means that data is being written to the flash drive. (Is this a good assumption?) With just rtorrent running, there's not much flashing, maybe 10 - 20 times/minute. I'm not sure why it's writing to the boot flash drive, but it does. Maybe it's swap activity.
However when rsync is running, the boot flash drive LED just flashes on and off like crazy. The daily rsync run takes anywhere from three to 30 minutes, depending on how much new data was downloaded each day. But no matter how long it takes, the flash drive LED just flashes like crazy the whole time.
I've checked this with iostat and have verified that while rsync is running between the two usb hard disks, there is a significantly (one to two orders of magnitude) greater amount of writing to the boot flash drive than when only rtorrent is running. I have a feeling that this may be what wore out the original boot flash drive.
I'm unclear on why this is. I'm unclear on why rsync should cause any writes to the boot flash drive. I would think that once rsync starts, all of its code would be loaded into RAM and execute from there and that chunks of data from the usb hard disks would be loaded to RAM and then would be compared, processed, etc., there. Why does it need to read/write from/to the boot flash drive over and over when I'm not rsyncing any of the data to or from the boot flash drive?
Is there a way to get rsync not to do this and to do its thing in RAM only and not write to the boot flash drive?
Would it work to change the relevant line in /etc/fstab from
/dev/root / ext2 noatime 0 1
to
/dev/root / ext2 ro 0 1
?
Or would this break things horribly? I have rtorrent configured so that all of its data is on the usb hard disks - it shouldn't be writing anything to the boot flash drive.
Or can I set the boot disk to read-only after boot or something like that?
What makes this very confusing to me is that I frequently boot machines from a Clonezilla liveusb (which is Debian-based) to duplicate, restore, and make images of multi-GB hard disks and portable storage devices (flash drives, SD cards). Once I start the operation, the Clonezilla liveusb just sits there unblinkingly and evidently unwritten to while large amounts of data are shuffled between madly blinking non-boot usb hard disks, etc.
Any ideas on this are appreciated.
Edited 1 time(s). Last edit at 03/10/2011 03:07PM by hanker.