Subject: Re: can a partition be expanded?
To: John Valdes <j-valdes@uchicago.edu>
From: Frederick Bruckman <fb@enteract.com>
List: port-mac68k
Date: 06/26/1999 17:05:13
On Sat, 26 Jun 1999, John Valdes wrote:
> Also, while you're at it, you'd might as well backup all your
> filesystems, just in case... :) You can put multiple dump images on a
> single tape (assuming they fit) by using the "no-rewind" tape device,
> /dev/nrst0, w/ the dump command, eg:
>
> dump -0 -u -B 4096000 -f /dev/nrst0 /usr
>
> You'll need to use a separate dump command for each filesystem, eg:
>
> dump -0 -u -B 4096000 -f /dev/nrst0 /
> dump -0 -u -B 4096000 -f /dev/nrst0 /usr
> dump -0 -u -B 4096000 -f /dev/nrst0 /var
> dump -0 -u -B 4096000 -f /dev/nrst0 /home
It's even easier than that. Since /dev/nrst0 is the default,
dump -0uB 4096000 / /usr /var /home
does the same thing. I have mixed feelings about multiple files on one
tape, though. On the one hand, it's economical of tape; on the other,
it will take just about as long, in this example, to restore /home as
it does to restore all four. I tend to do it only for the small ones.
> Actually, for repartitioning, is the BSD disklabel command safe to run
> on Mac disks, or must one use a MacOS disk partitioning utility? If
> disklabel is safe, then the complete procedure would be:
Um... No. "disklabel -r ..." writes a disklabel, but the kernel never
reads it. The written disklabel goes at the bottom of sector zero,
where it doesn't overwrite anything critical. LaCie's Silverlining
does put settings there, though, so it will demand that you
reinstall the driver the next time you run it. It's a case of
"it can't help you, but it can hurt you."
> - reboot into single-user mode (by setting the appropriate option
> in the NetBSD Booter)
> - umount /usr
> - dump -0 ... /usr (if you haven't already)
> - disklabel -e /dev/rsdNx
> - newfs, fsck, mount, restore as above.
>
> Another potential gotcha is that w/o /usr, you won't have any man pages
> either, so be sure you're familiar w/ all the commands above before
> proceeding (or print out copies of the relevant man pages ahead of
> time).
Agreed. Another thing is, once you've rearranged your partitions (and
user Mkfs to set the types), you don't really know where they're going
to go in the disklabel. You may have to edit your fstab from
single-user mode using "ed". Either that, or mount everything by hand
once.
It really sucks not having a /usr. What I've done in the past, is put
a root and /usr on a spare partiton and then boot from that to put all
the pieces togethor. Dump and restore are great for that, too. E.g.
mount /altroot
cd /altroot
dump -0 -f - / | restore -x -f -
cd /altroot/usr
dump -0 -f /usr | restore -x -f -
It gets more complicated if /usr has /usr/src, /usr/pkgsrc etc, which
you'd rather pick up from the tape later. In that case, I'd use "pax":
cd /usr
pax -r -w -pe -v bin doc include lib libdata libexec pkg \
sbin share /altroot/usr/