DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I realize this question comes up every now and then, and have found quite a bit of information regarding the subject. I just want to make sure I'm not missing anything. A few configuration tweaks I've found:
1. Do not format a swap partition (not a problem, have 4GB of memory for a system that will probably use <256MB.
2. Don't use ext3 as its journaled (so what file system should I use? ext2?)
5. Mount filesystem as read only (is this really necessary, and if so how is it done)
In case anyone is wondering, the system is basically going to be a NAS. It will run OpenSSH, ifenslave-2.6, and iscsitarget ONLY (besides a standard system install). I got tired of dealing with FreeNAS and Openfiler, so I played around with creating RAID arrays and ethernet bonding and feel I can do it better myself.
If anyone could answer some of the questions, or provide any more tips for reducing writes to a CF card I'd be much appreciative.
Yep, never make a swap partition on usb thumbdrives/cf cards,etc
ext2 vs ext3
which is more important to you?
more writes to usb but better data integrity with ext3
vs
less space used & slightly less writes with less data integrity with ext2
I personally use ext2 on persistent usb installs
as it "seems" to be healthier for life of USB
Not sure about logs?
I always usually have my /etc/fstab
setup so usb is mounted rw
though some distro's
when running in non-persistent mode
will run from usb and will have usb mounted as read-only
here's my lenny hd install /etc/fstab
it sees usb as sda1
Code:
/dev/sda1 /media/usb0 auto user,norelatime,noauto,rw 0 0
5. Mount filesystem as read only (is this really necessary, and if so how is it done)
Yes due to the limited number of write cycles CF cards have, this is required. I had to do a similar thing. As well as the things mentioned above, run "tune2fs -c 0 /dev/hdaxx" "and tune2fs -i 0 /dev/hdaxx" to stop mount counts, which are also writes to the CF.
Y'all have been incredibly helpful, just to sum everything up:
No Swap
EXT2
Changes to /etc/fstab
/dev/"cf_card" / defaults,noatime,ro 0 0 - Changes the root file system to read only, and turns off file modification counts
none /tmp tmpfs defaults 0 0 - Changes the /tmp directory to a tmpfs
none /var/tmp tmpfs defaults 0 0 - Changes the /var/tmp directory to a tmpfs
none /var/log tmpfs defaults 0 0 - Changes the /var/log directory to a tmpfs
Changes to /etc/defaults/rcS
RAMRUN=yes - Changes the /var/run directory to a tmpfs
RUNOCK=yes - Changes the /var/lock directory to a tmpfs
and finally
"tune2fs -c 0 /dev/hdaxx" "and tune2fs -i 0 /dev/hdaxx" - Stops mount counts and interval between file system checks.
The only thing I don't really understand why is:
Quote:
-for the network you must change directory /etc/networking to /var/ (each boot, ifstate file)
Just have 2 more questions. Say I make all these changes, and want to run apt-get upgrade later will it work? Or will I have to change the / file system to read-write? This leads me into my next question, can I put everything in one partition(the default install)? Or do I need to have separate partions.
"apt-get upgrade will certainly NOT work" = yes, that is true
i hade several cf-cards damaged with rw system so i choose read-only (desktop, state files, /tmp /var ...)
The network start script (/etc/rcS.d/SXXnetworking ) start the network
and write in the state file (/etc/network/run/ifstate) the existing interfaces.
If it is read-only the network wont start
(the simple way is to change directory to some rw place
i think it's better, anyway it will make some error messages "unable to write..."
i only have few basic rc scripts, like hostname, proc, basic mount -a ...
(faster boot, made this way 5,5 seconds boot with matchbox-window-manager+idesk)
to do it simple: juste make some OLD directory and move all of the symbolic links ( that you don't need) from rcS.d and rc2.d
to the OLD directory (easier than update-rc.d)
and if you need them back you can just move them from "OLD" to initial place
(DON'T move the udev script)
You can also mount you log directory to tmpfs
fstab:
none /var/log tmpfs defaults 0 0
(and the created logs will be present until the next reboot or shutdown)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.