LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Debian server on usb sticks (https://www.linuxquestions.org/questions/linux-hardware-18/debian-server-on-usb-sticks-663204/)

Matizek 08-16-2008 07:56 AM

Debian server on usb sticks
 
Hi!

I am planning to build a debian server which will use usb sticks instead of hard disks in order to reduce power consumption, noise and heat. My questions:

1.) Could you please make an opinion about this? I'd like to know whether it is reasonable to use USB sticks instead of hard disk. I don't really need much space.
2.) The thing I am mostly concerned about is how durable are these USB sticks? I mean, will they last for several years, in theory? This server will be mostly used as a web, mail, dns and ftp server.
3.) How much slower will the system be? I mean, for the upper purposes, will it be okay? Will a php/mysql based webpage load significantly longer?
4.) I will probably use two USB sticks, one 8gb as / and /home and one 2gb as swap. Will two USB sticks consume less power than one 3,5" 40Gb 5400Rpm drive?
5.) I would like to make my server as reliable as possible, should I use RAID1 with usb sticks? If I choose raid, I will have to use software raid, as my hardware does not support it. I was thinking about what this guy did: http://cs.joensuu.fi/~mmeri/usbraid/

Thanks!

estabroo 08-16-2008 04:03 PM

1) Sure its reasonable
2) Depends on how much writing you are doing to them
3) It's slower no doubts on that, but you can frontend the web server and ftp server with squid running out of ram
4) Put more ram in and skip swap (or make a really small ramdisk swap if the system wants it)
4a) What works nice is putting your OS on one that is read only and do a unionfs with either a ram disk or the other stick where you're putting all your non-static data
5) if you can do 4a that greatly increases the life since you aren't writing to it at all, I think doing regular backups would be easier than raiding a couple of sticks together (imho).

Matizek 08-17-2008 03:29 AM

Thanks for the answer!
3.) Could you explain this a bit please? I mean, I uderstand that running www and ftp from ram is just like running them from disk but instead of reading from disk constantly it reads from disk only once and then stores temporarily in ram, as ram is faster to read from. But what is squid? Isn't that some sort of proxy program?
4.) Would this much ram be enough: http://matizek.no-ip.org/phpsysinfo/
4a.) Ok I don't really understand this one :) How can you make OS-disk read only? I'm pretty sure it still needs some writings, in /etc for example... Correct me if I'm wrong please. Secondly, what is unionfs? I don't really understand it from here.

Thanks!

estabroo 08-17-2008 10:15 AM

Okay for 3) your using squid as a reverse proxy or web accelerator, it essentially allows people hitting your website to have what hasn't changed or timed out to be fed from squid running out of ram instead of having to hit the webserver and I'm pretty sure you can use it to do the same thing for ftp (but I could be wrong on that one). Just google squid as a reverse proxy and you'll get a ton of pages that explain it.

4) can you ever have too much ram? The answer is maybe, depends on what you end up running, personally I'd put in as much as I could.

4a) you can do this a couple of ways, the most common would be to use something like squashfs or cramfs, they are compressed read-only filesystems designed to run out of flash or out of ram (I prefer squashfs over cramfs). Unionfs lets you overlay directories so you can have a read-only directory and a writable one sharing the same directory. This is how most live CDs work, they make a union of a readonly filesystem and a ramdisk (or usb stick/drive marked for persistent storage)

Code:

/etc_readonly \
              /etc (union of both, reads come from readonly unless they've been updated in writable)
/etc_writeable/

mmm my ascii art leaves much to be desired

Matizek 08-17-2008 01:33 PM

Oh I see! I will use the unionfs, thanks for enlightening me :) If needed, I'll add more ram and if the web server will be too slow, I'll make it run from ram :) Thanks again!


All times are GMT -5. The time now is 09:35 PM.