Re: linking

2004-08-10 Thread Gary Mulder

Say you want to move /usr/local to live in /muz, where you have scads of
space.   Do the following.
  (I have my own naming convention that helps me keep track of things
   you can name things as you like - but try to be mnemonic).
or alternatively do (and preferably from single user mode, with a mount 
-a to mount all of the fs):

cd /usr
tar cf - ./local | (cd /muz; tar xf -)
find ./local -type f -exec cksum {} \;  /var/tmp/cksums_usr
cd /muz
find ./local -type f -exec cksum {} \;  /var/tmp/cksums_muz
diff /var/tmp/cksums_*
(the cksum output files should be identical...)
rm -r /usr/local
ln -s /muz/local /usr/local
Gary

--
Gary Mulder   mailto:[EMAIL PROTECTED]
Info Tech, Inc.
5700 SW 34th Street, Suite 1235 Phone: (352) 381-4400
Gainesville, FL 32608 Fax: (352) 381-
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: A question about /tmp

2004-08-09 Thread Gary Mulder
Of course having /tmp - /var/tmp means that you have no valid /tmp in 
single user mode where /var is not mounted. That is unless you created 
/var/tmp in single user mode, but that would mean /var would be mounted 
over the root partition's /var/tmp dir in multi-user mode, which can be 
non-intuitive to say the least.

The net result of not having a valid /tmp is that some commands issued in 
single-user mode may fail non-obviously as they might (reasonably?) assume 
/tmp is available.

Gary
At 04:50 AM 8/9/2004 , [EMAIL PROTECTED] wrote:
On Mon, Aug 09, 2004 at 10:32:50AM +0200, roland Mathieu wrote:

 Hello,

 I want to install FreeBSD with a small root partition. It's
 possible to use a different partition for /tmp, but /tmp can also be a
 symbolic link pointing, for example, /var/tmp. Is it a good idea ? If not
 what sort of problem will I encounter ?
There's nothing wrong with a symlink. I have /tmp - /var/tmp on
all my servers and never noticed the difference to a dedicated
/tmp partition. Theoretically, you'd experience a small performance
hit, but only if you open(2) many /tmp files very very often.
Even with a make buildworld, or a portupgrade -aRrkf, I didn't
notice any difference in speed. Of course, YMMV.
-cpghost.
--
Gary Mulder   mailto:[EMAIL PROTECTED]
Info Tech, Inc.
5700 SW 34th Street, Suite 1235 Phone: (352) 381-4400
Gainesville, FL 32608 Fax: (352) 381-
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: file system setup for new system - recommendations?

2004-08-09 Thread Gary Mulder
Just my $0.02NZ on this question:
First off partitions -
The first thing I do in single user mode in FreeBSD is mount /usr to access 
basic commands such as more, etc., so what is the point of having / and 
/usr on separate partitions? Thus I usually allocate 4 to 8GB to / and 
don't have a separate /usr partition. Can anyone posit a problem with 
combining / and /usr?

It was (as far as I know) an old rule of thumb to have swap twice your 
physical memory size. This was in the good ole days when memory was 
expensive and disk was comparatively cheap. These days if you are having to 
use two times your memory's worth of swap in normal activity it is time to 
buy more memory. However, since crash dumps are stored in the swap 
partition (note that they're not by default, you need to define dumpdev in 
/etc/rc.conf, see rc.conf(5) for more details) you'll want your swap as 
large as the maximum memory you expect to have on the system.

/tmp should be on a separate partition to prevent overflow of the / 
partition. A few GB of disk here is nice, dependent on the nature of 
programs you plan to run.

/var should be sized appropriate to what will be logged/stored in /var. For 
a Desktop, a few GB is probably sufficient. For a server with mail, web, 
ftp, etc. services 4-8GB is nice.

The remainder is traditionally allocated to /home.
Next Vinum and backups -
Vinum provides a number of configurations (RAID 0, 1, 1+0, 0+1, 5, etc.) 
for data redundancy. It requires two or more disks (depending on which RAID 
level), typically of the same type and size on separate controllers. It is 
somewhat complex to setup but provides a lot of flexibility in configuration.

It is important to note that using RAID for data redundancy is NOT data 
backup. A redundant RAID configuration will happy mirror file system 
corruption, inadvertent user file deletions, etc.

Backup however implies a secure and independent copy of the primary system 
data. Ideally this copy is not just kept on the same disk as the primary 
data. How useful are your backups if you lose the drive that has both your 
system and its backups?


Here is a proposed setup for a small to medium sized Unix server with say a 
120GB and 80GB ATA disks:

Set up the 80GB disk as the master on the first controller. Set up the 
120GB drive as master on the second controller and the CDROM drive as slave.

Side Note: Accessing the CDROM drive with this configuration may then 
greatly impact performance of the 120GB drive and you may instead want to 
put the 120GB drive as the slave on controller 1. However there is then the 
chance that if either hard drive goes bad it will hang controller 1 (a 
known problem with ATA controllers) and thus the system. If you use the 
CDROM infrequently I feel it is best to have the second hard drive on 
controller 2 as master and CDROM as slave. YMMV.

Partition map:
/   -  8GB
swap-  1GB
/tmp-  4GB
/var-  4GB
/home   - 63GB (ie. the rest of the disk).
Next use the following instructions to set up vinum to mirror the 80GB 
drive to the first 80GB of the 120GB drive. You have to be VERY careful 
with setting the partition types, calculating the disklabel offsets and 
corresponding vinum offsets and making sure the disk labels are written 
correctly:

http://devel.reinikainen.net/docs/how-to/Vinum/
The remaining 40GB of the 120GB drive can then be mounted as an unmirrored 
/backup partition. Alternatively, if you have two identical drives (or a 
third smaller drive) configure a mirrored /backup partition (or dedicate 
the third drive) for even more backup redundancy.

There are then a number of methods to perform backup, such as dump/restore, 
tar, cpio, Amanda, rsync-backup. My preference is GNU tar due to its 
portability among Unixes and other OSes. An example of creating a 
compressed full backup would be:

nice tar --exclude /backup --totals -cj -f /backup/`date +%s``.tar.bz2 /
This could be run out of cron say every night or weekend. With some 
scripting it could be made more space efficient by using the 
--listed-incremental option of GNU tar to say to full backups each 
weekend and incremental backups each day.

One program I have recently looked into is rdiff-backup. It uses rsync 
libraries to make an uncompressed mirror (as in copy, not RAID 1) of the 
entire system and then keep backward diffs of changes to the system so that 
it is very easy and fast to do point-in-time restores (or even use the 
mirror directly with chroot in extremis).

The only issue with rdiff-backup that I can see is that unlike traditional 
full image plus incremental backups, rdiff uses current mirror image minus 
incremental diffs, which means if you lose your mirror image you can no 
longer do point-in-time restores of the entire system. You can however 
restore files that have changed from the diffs.

Gary
--
Gary Mulder   mailto:[EMAIL PROTECTED]
Info Tech, Inc.
5700 SW

Re: Only root is able to login

2004-08-05 Thread Gary Mulder
Is root's shell /bin/sh? If not, then something is wrong with /bin/sh.
You should have another shell available to do some comparison testing (eg. 
/bin/csh). Use vipw  to change the abc user's shell to say /bin/csh.

Can you now login as abc? If so, then something is wrong with /bin/sh. If 
not, then it implies that the problem is not specifically with /bin/sh.

Assume you can login as abc using /bin/csh. Try simply running /bin/sh. 
Does it work? If not, then again /bin/sh is broke somehow, replace it with 
/bin/sh from another identical system (I run 4.10, sorry...)

Gary
--
Gary Mulder   mailto:[EMAIL PROTECTED]
Info Tech, Inc.
5700 SW 34th Street, Suite 1235 Phone: (352) 381-4400
Gainesville, FL 32608 Fax: (352) 381-
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Remote backup hosting setup?

2004-08-04 Thread Gary Mulder
Check out rdiff-backup:
http://rdiff-backup.stanford.edu
It not only generates a mirror copy of the current system, but also 
generates diff files that can be applied to the mirror to do a 
point-in-time restore.

Gary
--
Gary Mulder   mailto:[EMAIL PROTECTED]
Info Tech, Inc.
5700 SW 34th Street, Suite 1235 Phone: (352) 381-4400
Gainesville, FL 32608 Fax: (352) 381-
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


vinum create drive problem, can't add second disk to config

2004-07-27 Thread Gary Mulder
All,
I have two 160GB disks I want to mirror (ad0 and ad2). I loaded a fresh 
install FreeBSD 4.10-RELEASE on the boot disk, and are following the 
mirroring instructions at:

http://devel.reinikainen.net/docs/how-to/Vinum/
I have successfully added one half of the mirror and now are booting off 
the vinum devices (the vinum devices fsck and boot fine). However I 
persistently get the following error when adding the second disk.

Here's my environment:
# uname -a
FreeBSD testbox 4.10-RELEASE FreeBSD 4.10-RELEASE #0: Tue May 25 22:47:12 
GMT 2004 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/GENERIC  i386

# disklabel -r ad2s1
snip
8 partitions:
#size   offsetfstype   [fsize bsize bps/cpg]
  c: 3201593220unused0 0# (Cyl.0 - 19928*)
  h: 320159306   16 vinum   # (Cyl.0*- 19928*)
Note that the fstype of /dev/ad2s1h is correctly set to vinum, a common 
cause of the following vinum error, but apparently not the cause of my problem.

# ls -l /dev/ad2s1h
crw-r-  2 root  operator  116, 0x00020017 Jul 26 21:23 /dev/ad2s1h
And here is how I am trying to add the second disk:
# cat /etc/vinum1_onlydrive.conf
drive mirror1 device /dev/ad2s1h
# vinum create /etc/vinum1_onlydrive.conf
   1: drive mirror1 device /dev/ad2s1h
** 1 : Invalid argument
1 drives:
D mirror0   State: up   Device /dev/ad0s1h  Avail: 
0/156327 MB (0%)

5 volumes:
V swap  State: up   Plexes:   1 Size:511 MB
V root  State: up   Plexes:   1 Size:   4096 MB
V usr   State: up   Plexes:   1 Size:   4096 MB
V var   State: up   Plexes:   1 Size:   4096 MB
V home  State: up   Plexes:   1 Size:140 GB
5 plexes:
P swap.p0 C State: up   Subdisks: 1 Size:511 MB
P root.p0 C State: up   Subdisks: 1 Size:   4096 MB
P usr.p0  C State: up   Subdisks: 1 Size:   4096 MB
P var.p0  C State: up   Subdisks: 1 Size:   4096 MB
P home.p0 C State: up   Subdisks: 1 Size:140 GB
5 subdisks:
S swap.p0.s0State: up   PO:0  B Size:511 MB
S root.p0.s0State: up   PO:0  B Size:   4096 MB
S usr.p0.s0 State: up   PO:0  B Size:   4096 MB
S var.p0.s0 State: up   PO:0  B Size:   4096 MB
S home.p0.s0State: up   PO:0  B Size:140 GB
# tail -4 /var/log/vinum_history
27 Jul 2004 20:54:33.452226 *** vinum started ***
27 Jul 2004 20:54:33.452846 create /etc/vinum1_onlydrive.conf
drive mirror1 device /dev/ad2s1h
27 Jul 2004 20:54:33.471889 *** Created devices ***
# tail -1 /var/log/messages
Jul 27 20:54:33 testbox /kernel: vinum: drive mirror1 is up
I am either missing something obvious or something strange is occurring.
The above vinum how-to suggests using the -f option to create for the 
second disk. However when I do this the drive count in vinum list goes up 
but mirror1 is never created.

Any help would be appreciated!
Thanks,
Gary
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]