ufsdump root without /var or /usr

  • Follow


I am trying to move/upgrade a sol10 box to a larger disk and also
rearrange the partitions.

I have done this many times before, but never split up the existing
root partition.  The usual ufsdump to stdout piped to ufsrestore to
new partition also copies /var and /usr which I don't want to do.  The
original setup had a two partitions, / and /export/home.  I want to
split up the disk to a larger /, /var, /usr and /export/home.  I
copied the /usr and /var last night successfully using tar, but never
gave it much thought with regards to recreating / minus /usr and /var
partitions

Additionally, when trying my normal script for this function, it
complained about installboot too.  I haven't tried using installgrub,
but will try later, is there any surprises I should be aware off with
regards to grub?

Thanks in advance,

Mike Dundee

0
Reply eeb4u (26) 2/2/2007 4:58:17 PM

eeb4u@hotmail.com <eeb4u@hotmail.com> wrote:
> I am trying to move/upgrade a sol10 box to a larger disk and also
> rearrange the partitions.

> I have done this many times before, but never split up the existing
> root partition.  The usual ufsdump to stdout piped to ufsrestore to
> new partition also copies /var and /usr which I don't want to do.

Don't have the disk space?  I would just copy it then delete the extra
bits.

Otherwise, pre-create /var and /usr mount points, then mount the
filesystems.  When you run the restore, it'll put the data in the new
filesystems.

  The
> original setup had a two partitions, / and /export/home.  I want to
> split up the disk to a larger /, /var, /usr and /export/home.  I
> copied the /usr and /var last night successfully using tar, but never
> gave it much thought with regards to recreating / minus /usr and /var
> partitions

Tar can take exclude files.

> Additionally, when trying my normal script for this function, it
> complained about installboot too.  I haven't tried using installgrub,
> but will try later, is there any surprises I should be aware off with
> regards to grub?

What was the complaint? 

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 2/2/2007 9:47:16 PM


On Feb 2, 4:47 pm, Darren Dunham <ddun...@redwood.taos.com> wrote:
> e...@hotmail.com <e...@hotmail.com> wrote:
> > I am trying to move/upgrade a sol10 box to a larger disk and also
> > rearrange the partitions.
> > I have done this many times before, but never split up the existing
> > root partition.  The usual ufsdump to stdout piped to ufsrestore to
> > new partition also copies /var and /usr which I don't want to do.
>
> Don't have the disk space?  I would just copy it then delete the extra
> bits.
>
> Otherwise, pre-create /var and /usr mount points, then mount the
> filesystems.  When you run the restore, it'll put the data in the new
> filesystems.
>
>   The
>
> > original setup had a two partitions, / and /export/home.  I want to
> > split up the disk to a larger /, /var, /usr and /export/home.  I
> > copied the /usr and /var last night successfully using tar, but never
> > gave it much thought with regards to recreating / minus /usr and /var
> > partitions
>
> Tar can take exclude files.
>
> > Additionally, when trying my normal script for this function, it
> > complained about installboot too.  I haven't tried using installgrub,
> > but will try later, is there any surprises I should be aware off with
> > regards to grub?
>
> What was the complaint?
>
> --
> Darren Dunham                                           ddun...@taos.com
> Senior Technical Consultant         TAOS            http://www.taos.com/
> Got some Dr Pepper?                           San Francisco, CA bay area
>          < This line left intentionally blank to confuse you. >

currently / is on a 4gb (ish) slice which includes var and usr and I
wanted to put / on a separate 1GB, /usr on a 6gb and /var on a 3gb
remainder on /export/home.

normally I just ufsdump 0f - / | (cd /mnt; ufsrestore xf -) but this
will fill up my 1GB partition.  Are you saying just do "tar cvf - /usr
| (cd /tmp_usr; tar xvpf -) for both /usr and /var, modify vfstab to
mount new slices on reboot, next reboot then do my ufsdump of /
slice.  (I am assuming the ufsrestore of root will write to the newly
mounted /var and /usr.  Afterwards, installboot and modify the vfstab
and boot record to point at new disk.

the installboot just complained about it being obsolete and that I
should use installgrub.

Thanks,

Mike

0
Reply eeb4u 2/2/2007 11:18:46 PM

On Feb 2, 6:18 pm, "e...@hotmail.com" <e...@hotmail.com> wrote:
> On Feb 2, 4:47 pm, Darren Dunham <ddun...@redwood.taos.com> wrote:
>
>
>
> > e...@hotmail.com <e...@hotmail.com> wrote:
> > > I am trying to move/upgrade a sol10 box to a larger disk and also
> > > rearrange the partitions.
> > > I have done this many times before, but never split up the existing
> > > root partition.  The usual ufsdump to stdout piped to ufsrestore to
> > > new partition also copies /var and /usr which I don't want to do.
>
> > Don't have the disk space?  I would just copy it then delete the extra
> > bits.
>
> > Otherwise, pre-create /var and /usr mount points, then mount the
> > filesystems.  When you run the restore, it'll put the data in the new
> > filesystems.
>
> >   The
>
> > > original setup had a two partitions, / and /export/home.  I want to
> > > split up the disk to a larger /, /var, /usr and /export/home.  I
> > > copied the /usr and /var last night successfully using tar, but never
> > > gave it much thought with regards to recreating / minus /usr and /var
> > > partitions
>
> > Tar can take exclude files.
>
> > > Additionally, when trying my normal script for this function, it
> > > complained about installboot too.  I haven't tried using installgrub,
> > > but will try later, is there any surprises I should be aware off with
> > > regards to grub?
>
> > What was the complaint?
>
> > --
> > Darren Dunham                                           ddun...@taos.com
> > Senior Technical Consultant         TAOS            http://www.taos.com/
> > Got some Dr Pepper?                           San Francisco, CA bay area
> >          < This line left intentionally blank to confuse you. >
>
> currently / is on a 4gb (ish) slice which includes var and usr and I
> wanted to put / on a separate 1GB, /usr on a 6gb and /var on a 3gb
> remainder on /export/home.
>
> normally I just ufsdump 0f - / | (cd /mnt; ufsrestore xf -) but this
> will fill up my 1GB partition.  Are you saying just do "tar cvf - /usr
> | (cd /tmp_usr; tar xvpf -) for both /usr and /var, modify vfstab to
> mount new slices on reboot, next reboot then do my ufsdump of /
> slice.  (I am assuming the ufsrestore of root will write to the newly
> mounted /var and /usr.  Afterwards, installboot and modify the vfstab
> and boot record to point at new disk.
>
> the installboot just complained about it being obsolete and that I
> should use installgrub.
>
> Thanks,
>
> Mike

Or were you suggesting ufsdump / and just rm -r /usr and /var during
ufsrestore from another terminal?

Mike

0
Reply eeb4u 2/3/2007 12:48:25 AM

>> Tar can take exclude files.

> currently / is on a 4gb (ish) slice which includes var and usr and I
> wanted to put / on a separate 1GB, /usr on a 6gb and /var on a 3gb
> remainder on /export/home.

> normally I just ufsdump 0f - / | (cd /mnt; ufsrestore xf -) but this
> will fill up my 1GB partition.  Are you saying just do "tar cvf - /usr
> | (cd /tmp_usr; tar xvpf -) for both /usr and /var, modify vfstab to
> mount new slices on reboot, next reboot then do my ufsdump of /
> slice.  (I am assuming the ufsrestore of root will write to the newly
> mounted /var and /usr.  Afterwards, installboot and modify the vfstab
> and boot record to point at new disk.

Actually, my initial comment was suggesting that you could use exclude
files to tar up only the root filesystem and exclude the contents of
/var and /usr.

But as you mention, both tar and ufsrestore should work fine with the
/usr and /var mounts in place.  So there's no need for a reboot or
anything.  Either tar or ufsdump all of the current root into /, /usr,
and /var on the target in one go.  You can immediately set up any boot
things at that point.

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 2/3/2007 7:33:37 AM

eeb4u@hotmail.com wrote:
> On Feb 2, 4:47 pm, Darren Dunham wrote:
>> Otherwise, pre-create /var and /usr mount points, then mount the
>> filesystems.  When you run the restore, it'll put the data in the new
>> filesystems.
> 
> currently / is on a 4gb (ish) slice which includes var and usr and I
> wanted to put / on a separate 1GB, /usr on a 6gb and /var on a 3gb
> remainder on /export/home.
> 
> normally I just ufsdump 0f - / | (cd /mnt; ufsrestore xf -) but this
> will fill up my 1GB partition.  Are you saying just do "tar cvf - /usr

I believe what Darren meant was something like

mount /dev/dsk/xxxxs0 /mnt
mount /dev/dsk/xxxxs5 /mnt/var
mount /dev/dsk/xxxxs7 /mnt/usr
ufsdump 0f - / | (cd /mnt; ufsrestore rf - )

while ufsdump does not cross mount points, ufsrestore does.
Of course you will still have to edit vfstab for the new /var and /usr 
mount points
0
Reply Oscar 2/5/2007 4:01:16 AM

On Feb 4, 11:01 pm, Oscar del Rio <del...@mie.utoronto.ca> wrote:
> e...@hotmail.com wrote:
> > On Feb 2, 4:47 pm, Darren Dunham wrote:
> >> Otherwise, pre-create /var and /usr mount points, then mount the
> >> filesystems.  When you run the restore, it'll put the data in the new
> >> filesystems.
>
> > currently / is on a 4gb (ish) slice which includes var and usr and I
> > wanted to put / on a separate 1GB, /usr on a 6gb and /var on a 3gb
> > remainder on /export/home.
>
> > normally I just ufsdump 0f - / | (cd /mnt; ufsrestore xf -) but this
> > will fill up my 1GB partition.  Are you saying just do "tar cvf - /usr
>
> I believe what Darren meant was something like
>
> mount /dev/dsk/xxxxs0 /mnt
> mount /dev/dsk/xxxxs5 /mnt/var
> mount /dev/dsk/xxxxs7 /mnt/usr
> ufsdump 0f - / | (cd /mnt; ufsrestore rf - )
>
> while ufsdump does not cross mount points, ufsrestore does.
> Of course you will still have to edit vfstab for the new /var and /usr
> mount points

I have done this but my original root (/) still shows 95% capacity.
For some reason, I though the original /usr and /var were still
available under lost+found after mounting the new partitions, but they
are not.  Where are the files that were on the original / slice under /
usr and /var so that I can delete them and free up some disk space?

Thanks,

Mike Dundas

0
Reply eeb4u 2/5/2007 7:52:58 PM

eeb4u@hotmail.com <eeb4u@hotmail.com> wrote:
> I have done this but my original root (/) still shows 95% capacity.
> For some reason, I though the original /usr and /var were still
> available under lost+found after mounting the new partitions, but they
> are not.  Where are the files that were on the original / slice under /
> usr and /var so that I can delete them and free up some disk space?

Run 'du -dk / | sort -n'.  That will show you what is taking up space.

If the root directory at the end of that listing doesn't agree with
'df', then overlay mounts may be hiding some files.  

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 2/5/2007 9:34:58 PM

On Feb 5, 4:34 pm, Darren Dunham <ddun...@redwood.taos.com> wrote:
> e...@hotmail.com <e...@hotmail.com> wrote:
> > I have done this but my original root (/) still shows 95% capacity.
> > For some reason, I though the original /usr and /var were still
> > available under lost+found after mounting the new partitions, but they
> > are not.  Where are the files that were on the original / slice under /
> > usr and /var so that I can delete them and free up some disk space?
>
> Run 'du -dk / | sort -n'.  That will show you what is taking up space.
>
> If the root directory at the end of that listing doesn't agree with
> 'df', then overlay mounts may be hiding some files.  

if overlay mounts are hiding some files, which I think they are,
df -k
/dev/dsk/c0d0s0      4144647 4012434   90767    98%    /
du -dk | sort -n (last line) 218102  .

what are my options for disk cleanup?  boot to single user mode and
delete /var, or boot to cdrom and delete /var and /usr?

This is obviously a problem that should have been addressed at
install, but reinstall is not immediatly practical as a website is
running on this server.  I have to plan ahead, but with an eye on an
immediate workaround,

Thanks,

Mike Dundas

0
Reply eeb4u 2/7/2007 5:56:53 PM

On Feb 2, 10:58 am, "e...@hotmail.com" <e...@hotmail.com> wrote:
> I am trying to move/upgrade a sol10 box to a larger disk and also
> rearrange the partitions.
>
> I have done this many times before, but never split up the existing
> root partition.  The usual ufsdump to stdout piped to ufsrestore to
> new partition also copies /var and /usr which I don't want to do.  The
> original setup had a two partitions, / and /export/home.  I want to
> split up the disk to a larger /, /var, /usr and /export/home.  I
> copied the /usr and /var last night successfully using tar, but never
> gave it much thought with regards to recreating / minus /usr and /var
> partitions
>
> Additionally, when trying my normal script for this function, it
> complained about installboot too.  I haven't tried using installgrub,
> but will try later, is there any surprises I should be aware off with
> regards to grub?
>
> Thanks in advance,
>
> Mike Dundee

http://docs.sun.com/app/docs/doc/819-6396/6n8dosoq5?q=lucreate&a=view

Liveupgrade may be helpful.

0
Reply krisia 2/7/2007 6:00:59 PM

eeb4u@hotmail.com <eeb4u@hotmail.com> wrote:
> if overlay mounts are hiding some files, which I think they are,
> df -k
> /dev/dsk/c0d0s0      4144647 4012434   90767    98%    /
> du -dk | sort -n (last line) 218102  .

> what are my options for disk cleanup?  boot to single user mode and
> delete /var, or boot to cdrom and delete /var and /usr?

That would work.

Another option that folks have used in the past is to share the root
filesystem with NFS temporarily.  NFS will not traverse the overlay
mounts, so you can clean up on the client.

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 2/7/2007 7:04:38 PM

On Feb 7, 2:04 pm, Darren Dunham <ddun...@redwood.taos.com> wrote:
> e...@hotmail.com <e...@hotmail.com> wrote:
> > if overlay mounts are hiding some files, which I think they are,
> > df -k
> > /dev/dsk/c0d0s0      4144647 4012434   90767    98%    /
> > du -dk | sort -n (last line) 218102  .
> > what are my options for disk cleanup?  boot to single user mode and
> > delete /var, or boot to cdrom and delete /var and /usr?
>
> That would work.
>
> Another option that folks have used in the past is to share the root
> filesystem with NFS temporarily.  NFS will not traverse the overlay
> mounts, so you can clean up on the client.
>
> --
> Darren Dunham                                           ddun...@taos.com
> Senior Technical Consultant         TAOS            http://www.taos.com/
> Got some Dr Pepper?                           San Francisco, CA bay area
>          < This line left intentionally blank to confuse you. >

As usual, right on the money!

got root down to under 10%.  Thanks for excellent advice.

Mike Dundas

0
Reply eeb4u 2/8/2007 4:58:55 AM

11 Replies
420 Views

(page loaded in 0.157 seconds)

Similiar Articles:


















7/21/2012 12:22:12 AM


Reply: