View previous topic :: View next topic |
Author |
Message |
tojo n00b
Joined: 09 Dec 2002 Posts: 72
|
Posted: Fri May 09, 2003 8:18 am Post subject: mounting all partitions to read-only |
|
|
I just got my gentoo linux freshly installed, because two days ago my reiserfs partitions went crazy. I had to do fresh install.
Now I'm wondering what to do if I want to set all partitions to read-only.
My memo with the idea:
- /usr : can be read-only all the time
- /etc : at the boot all mounts are written to mtab and /etc can't be it's own partition, so etc has to be writable at the boot time
- /var : has to be writable; logs, crontabs etc..
- /home : writable; of course if you want to do something
- /tmp : using tmpfs so this is not a problem, or this can be linked to /var/tmp
- root partition can be mounted afterwards to read-only(?), only thing with this is that because /etc is in root partition so if I mount cdroms or other removable device by normal user, system can't write to /etc/mtab (..but mounting still works, but it doesn't show these mounts when issuing mount command)
Any other ideas/opinions with this? |
|
Back to top |
|
|
silverter Guru
Joined: 10 Apr 2002 Posts: 491 Location: Ulm, DE
|
Posted: Fri May 09, 2003 1:58 pm Post subject: |
|
|
In order to mount a partition read only, you want to set the mount option ro in your /ets/fstab. Then at mount time, it will mount that partition read only. Do the same for all the partitions you would like to mount read only.
OTOH, what is the point of mounting your partitions read only? What if you need to update your software ?
What about backup on a regular basis on CD RW devices?
regards, _________________ -- A Guru was once a Beginner -- |
|
Back to top |
|
|
tojo n00b
Joined: 09 Dec 2002 Posts: 72
|
Posted: Fri May 09, 2003 2:53 pm Post subject: |
|
|
Quote: | OTOH, what is the point of mounting your partitions read only? What if you need to update your software ? |
Because filesystem is always more fragile when it is mounted read-write, maybe this some kind of paranoia but i'm just wondering, because there is no need for system's core files to be writable for all the time.. and maybe this is bit of protecting system from myself .. and maybe I should look for some kind of ACL system..
And when updating/installing software I can always issue command ex. : Code: | mount -o remount,rw /usr |
So that's not a problem.
Two or three days ago my system crashed and I had to do hard reset (power button) and when system tried to start kernel didn't recognize root's filesystem so I had to boot from "emergency" disk and tried to safe my files. I got my files back but reiserfstools mixed up my files so badly that I had to do fresh install. So, now i'm searching ways to prevent this happening again. This same thing happend me about two years ago too.
And for the backups, i'm too lazy to do cd-rw backups and i don't have a tape drive.. |
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Sun May 11, 2003 5:50 am Post subject: |
|
|
On the CD-RW backup topic. How do I do tar in multiple volumes?
Say I have 4GB to backup and I want them in CD-R like this:
backup-1.tar.bz2
backup-2.tar.bz2
backup-3.tar.bz2
...
where every .tar.bz2 is 650MB. What options do I need to pass to tar?
Thanks |
|
Back to top |
|
|
tojo n00b
Joined: 09 Dec 2002 Posts: 72
|
Posted: Sun May 11, 2003 6:24 am Post subject: |
|
|
Quote: | On the CD-RW backup topic. How do I do tar in multiple volumes?
Say I have 4GB to backup and I want them in CD-R like this:
backup-1.tar.bz2
backup-2.tar.bz2
backup-3.tar.bz2
...
where every .tar.bz2 is 650MB. What options do I need to pass to tar? |
I can't say for sure, but I think tar can't handle splitting file, but you can use "--multi-volume" option if you writing to tape or nother removable device. Program ask's you to change tape when it is full.
ex.
Code: | tar --multi-volume -cf /dev/fd0 somefiles |
For splitting a file you can use program like "split" to do it, but then you have to join the files together when you want untar them.
..but yesterday I found this nice program:
http://danborn.net/multicd/
It creates direct copies of your files to cd's and you can access to these files directly from cd. No need using tar or something. I found this program very handy
I made ebuild for this (save file as multicd-1.7.2.ebuild):
Code: | # Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION="Tool for making direct copies of your files to multiple cd's."
HOMEPAGE="http://danborn.net/multicd/"
SRC_URI="http://danborn.net/multicd/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ppc alpha sparc sparc64"
IUSE=""
RDEPEND=">=perl-5.6.1
>=app-cdr/cdrtools-1.11.33"
src_unpack() {
unpack ${P}.tar.gz
cd ${WORKDIR}
}
src_install() {
into /usr
dobin multicd
dodoc sample_multicdrc
}
pkg_postinst() {
einfo ""
einfo "Copy and edit sample configuration file from /usr/share/doc/${P}"
einfo "directory to /etc directory as "multicdrc"."
einfo ""
} |
|
|
Back to top |
|
|
nbensa l33t
Joined: 10 Jul 2002 Posts: 799 Location: Buenos Aires, Argentina
|
Posted: Sun May 11, 2003 7:15 am Post subject: |
|
|
Nice, thank you!! |
|
Back to top |
|
|
|