jedaffra
August 9th, 2002, 13:06
Hi,

Thanks for taking the time to read my questions. I'm a unix and OBSD newb.

I'm running a headless openbsd 3.0 on a wintel pIII with one network card that connects to the internet through an educational institution's firewall. I've been given free reign over one internal and one external IP. I have the box configured so that I can access it from inside of the office or outside from my home using WinSCP and PuTTY in both cases.

I wish to shut down the openbsd box, install a second network card, and update from 3.0 to 3.1, however, I have alot of data in my /home directory that I do not wish to move unless I have to.

I've heard it is possible to re-install openbsd and not lose data if it is in the /home directory. I wish to know if this is possible, and if it is, how I would go about doing this successfully.

Thanks,

elmore
August 9th, 2002, 13:17
I know |MiNi0n| is working on a project to do almost exactly what you're doing. Perhaps he will be gracious enough to post his notes. :D

jedaffra
August 9th, 2002, 13:47
I would be interested in that, but I'm not sure if I should I wait here or contact |MiNi0n| myself...?

I know |MiNi0n| is working on a project to do almost exactly what you're doing. Perhaps he will be gracious enough to post his notes. :D

Punk Walrus
August 9th, 2002, 13:53
I wish to shut down the openbsd box, install a second network card, and update from 3.0 to 3.1, however, I have alot of data in my /home directory that I do not wish to move unless I have to.

Is /home a different partition on the disk? Some people here have always made /home a separate disk volume, so that when they need to do a total refresh, they reformat everything *but* the /home volume. They usually set up stuff on each partition, so they don't lose what they don't want to when reformatting or fixing a hosed directory, like

swap volume
/ [root] volume
/usr volume
/var volume
/tmp volume [not sure why, this might be for security]
/home volume
/share volume

If you formatted everything like I first did, all under /usr as one big partition, all I can say is... uh... backup /hme on another disk, and reformat the whole disk again, next time save the /home volume as a separate disk partition.

Again, YMMV... if anyone else has better advice to contradict me, use their advice instead, because I am just one level above newbie myself, with OpenBSD and LINUX.

jedaffra
August 9th, 2002, 14:00
Well, being a newb, all I can say is that I followed the OpenBSD.org installation instructions to the letter.

The box I'm using only has the one HD, but I'm thinking, the installation sets up the /home dir as a separate partition [?]

Thanks PW


[quote:c4a123110f="Jedaffra"]I wish to shut down the openbsd box, install a second network card, and update from 3.0 to 3.1, however, I have alot of data in my /home directory that I do not wish to move unless I have to.

Is /home a different partition on the disk? Some people here have always made /home a separate disk volume, so that when they need to do a total refresh, they reformat everything *but* the /home volume. They usually set up stuff on each partition, so they don't lose what they don't want to when reformatting or fixing a hosed directory, like

swap volume
/ [root] volume
/usr volume
/var volume
/tmp volume [not sure why, this might be for security]
/home volume
/share volume

If you formatted everything like I first did, all under /usr as one big partition, all I can say is... uh... backup /hme on another disk, and reformat the whole disk again, next time save the /home volume as a separate disk partition.

Again, YMMV... if anyone else has better advice to contradict me, use their advice instead, because I am just one level above newbie myself, with OpenBSD and LINUX.[/quote:c4a123110f]

|MiNi0n|
August 9th, 2002, 14:04
I know |MiNi0n| is working on a project to do almost exactly what you're doing. Perhaps he will be gracious enough to post his notes. :D

Swell, thx elmore ;)

Actually, the project I'm working on is different... I'm using cvs to update to the patched versions of 3.0 and 3.1 and then using make release to create fully patched releases of 3.0 and 3.1 that I can drop on my ftp server and use for doing new installs.

That being said... I'll tackle this one anyway.

Let it be noted that backups are *always* recommended!

Judging from your post I'm assuming your wish is to start from scratch with a fresh install as opposed to upgrading? If not, just look here:

http://www.openbsd.org/faq/upgrade-minifaq.html

Otherwise, I quite honestly think your best bet is to tar up your /home directory and pull it off that server, reinstall and then untar your /home on the new install. The reason I say this is that the install of OBSD is gonna wanna newfs your partitions :(

What I do on my home box to avoid the above headache is put my /home on a secondary hard drive. That way I can just blow away the main drive containg / /etc /usr /var and /tmp, install the new OS then simply remount my /home :) Easy breezy... and a good solution considering the cost of hd's these days.

jedaffra
August 9th, 2002, 14:17
Let it be noted that backups are *always* recommended!

True, true...

Judging from your post I'm assuming your wish is to start from scratch with a fresh install as opposed to upgrading?

Yes, because I really know very little about *nix, my preference would be to freshly install 3.1 over upgrading 3.0 to 3.1 due to the fact that I wish to add a second nic... maybe even a second HD after reading your excellent advice re: intalling /home on a secondary HD.

I quite honestly think your best bet is to tar up your /home directory and pull it off that server, reinstall and then untar your /home on the new install.

Thanks. By the way, (and this is open to anyone) being a newb I'm unfamiliar with the procedure involved in "tarring". Can someone provide a "rtfm" or reasonable facsimile to get me started?

Cheers!

elmore
August 9th, 2002, 14:33
tar, well tar isn't really all that difficult.
I create g'zipped tarballs do doing the following:


tar czvfp /path/to/new/tar/archive.tar.gz /data/path/to/archive

to untar your data

tar xzvfp archive.tar.gz


for more on the options please man tar.

jedaffra
August 9th, 2002, 14:42
tar czvfp /path/to/new/tar/archive.tar.gz /data/path/to/archive

to untar your data: tar xzvfp archive.tar.gz


Your character must afford you many friends. Thank you.

Jedaffra

|MiNi0n|
August 9th, 2002, 14:45
Well I see elmore tersely replied to this already... but seeing as I wrote all this out... here it anyhow ;-)

Thanks. By the way, (and this is open to anyone) being a newb I'm unfamiliar with the procedure involved in "tarring". Can someone provide a "rtfm" or reasonable facsimile to get me started?

Well... rtfm really should be rtfm shouldn't it ;) However, last time I looked at the man for tar I cringed myself!

Here's the deal, you need to find enough space on your system to create the tar file in first so do a df -h to provide an output of your current disk usage... it'll look similar to:

aurora# df -h
Filesystem Size Used Avail Capacity Mounted on
/dev/wd0a 484M 76M 384M 16% /
/dev/wd0g 5.4G 1.6G 3.5G 32% /home
/dev/wd0d 124M 1.0K 118M 0% /tmp
/dev/wd0f 1.9G 910M 929M 49% /usr
/dev/wd0e 968M 220M 700M 24% /var
/dev/wd1h 1.8G 1.7G 30M 98% /u

Obviously, you look at how much /home has used and find a partition that has enough available.

Basic tar:

tar [options] /path/to/file.tar /directory/you/want/to/tar

So, say we wanted to create the tar in /usr, you'd do:

tar cvfpz /usr/home.tar /home

c for create
v verbose
f file
p keeps permissions same (else the tar will have the perms of the user you use to issue it... presumably root, important when doing homes!)
z compress it

You'll then have a new tar called home.tar.gz in /usr

BTW - Since you're upgrading to 3.1 from 3.0, I'd also create a tar of /etc for starters since you can simply move your conf files back into /etc on the new install :-)

Anyway, once you create the new setup and have a new /home created, you untar the file using:

cd /
tar xvfpz /path/to/file.tar.gz

Once you're happy with everything, remove the tar files.

In your case, tar the stuff up and then copy them over to your other computer, then move them back when the new install is done.

That's it.

jedaffra
August 9th, 2002, 15:05
Thanks for the full monty |MiNi0n| I appreciate that and I really did appreciate elmore's response too. I hope my response to his post didn't come off as sarcastic. I refuse to use sarcasm in a negtive way on these posts for the simple fact that I have so much to learn about this topic and there are too few people out there with a willingness to give of their time and talents. Those are the people you *dont* want to pee off!!

Cheers!

Well I see elmore tersely replied to this already... but seeing as I wrote all this out... here it anyhow ;-)

Well... rtfm really should be rtfm shouldn't it ;) However, last time I looked at the man for tar I cringed myself!

Here's the deal, you need to find enough space on your system to create the tar file in first so do a df -h to provide an output of your current disk usage... it'll look similar to: ........ etc etc

frisco
August 12th, 2002, 15:04
Helpful tip:
during install, if you have a tarball of the name site31.tgz then it will appear in the list of packages to select for install. So for your /home stuff, if it isn't in a separate dir, then the following will work:
with root privs-
cd /
tar -zcf /path/to/site31.tgz /home
place site31.tgz somewhere it can be accessed during install (on the install cd, ftp server, etc) and it will appear in the list of packages to install. it provides a convenient method to install your own stuff, so you might want to also place other port/packages you want in there if you're cloning machines, or your data, or other stuff.

by the way, dont forget to backup other stuff that you might need that isnt in your /home, like crontabs, mail, config files, etc.