moving /usr

moving /usr

Post by Gary Ferre » Wed, 14 Oct 1998 04:00:00



I have been unsuccessful in booting my Solaris 2.3 machine after moving /usr
to a different disk (on another controller) labeled /usr2.  I've tried
linking /usr to /usr2 but the system still will not boot.  My last attempt
will be to make changes to the vfstab (it's more direct) however I need to
know how can I change the /usr2 directory to /usr now that the original /usr
is gone?.  I'm afraid if I do just a cp -r the links will not be properly
managed.  I would have to do this from CD-ROM of course.
Any ideas?.
Thanks.
 
 
 

moving /usr

Post by Arran Pric » Thu, 15 Oct 1998 04:00:00



> I have been unsuccessful in booting my Solaris 2.3 machine after moving /usr
> to a different disk (on another controller) labeled /usr2.  I've tried
> linking /usr to /usr2 but the system still will not boot.  My last attempt
> will be to make changes to the vfstab (it's more direct) however I need to
> know how can I change the /usr2 directory to /usr now that the original /usr
> is gone?.  I'm afraid if I do just a cp -r the links will not be properly
> managed.  I would have to do this from CD-ROM of course.
> Any ideas?.
> Thanks.

Its early in the morning so I may have got a little confused reading the
above :)
what I understand from this tho is that
/usr2 is just a mount point so
in vfstab
change the the disk slice to the new /usr (which is what you called
usr2)
so before you starting messing with the system it was something like
this
/dev/dsk/c0t0d0s4 blah blah blah /usr (where c0t0d0s4 was the old
partition - this is prolly not correct for your system but you get the
idea)
just change that c0t0d0s4 bit to the new partition.

In brief all you want to do is mount your usr on usr rather than usr2
should be pretty simple.
and remove your symlink!!!, just make it  a mount point instead

Hope I havent confused you as much as I did myself :)

Arran
My opinions are my own and do not reflec those of my employer.

 
 
 

moving /usr

Post by Unix Sys Adm » Thu, 15 Oct 1998 04:00:00



> I have been unsuccessful in booting my Solaris 2.3 machine after moving /usr
> to a different disk (on another controller) labeled /usr2.  I've tried
> linking /usr to /usr2 but the system still will not boot.  My last attempt
> will be to make changes to the vfstab (it's more direct) however I need to
> know how can I change the /usr2 directory to /usr now that the original /usr
> is gone?.  I'm afraid if I do just a cp -r the links will not be properly
> managed.  I would have to do this from CD-ROM of course.
> Any ideas?.
> Thanks.

   You have really a mess here and you ought to explain exactly how your
machine is right now before you go any further, from there I am sure you
will find  sound advice in this newsgroup.

   Could you please post a copy of you actual /etc/vfstab file as well as
an explanation of how are /usr and /usr2 configured (is any one of them a
link, a filesystem, a subdirectory? More details please!)

  Now, to move FILESYSTEMS you can use this command:

ufsdump 0f  -  /dev/rdsk/cwtxdysz | (cd /target_dir;ufsrestore xf - )

where: /dev/rdsk/cwtxdysz is the raw partition where your source
filesystem is living. Change w,x,y,z as appropiate and if in doubt ask
first.

Cheers

 
 
 

moving /usr

Post by Death Walke » Thu, 15 Oct 1998 04:00:00


I've done this before, it has worked and it has failed (very painful).

init 1 (single user mode)

make the new directory as you have indicated you already have, with a
unique name.

Copy the files from device to device with:
        find {source_dir} -print | cpio -pmud {target_dir}
                        -or-
        tar cvf - {source_dir} | tar xvf - {target_dir}
                        -or-
        bounce it to-from tape.  This has advantages is all else failes!

{hopefully you used the /etc/vfstab for creating the temp usr directory}

reverse the naming in /etc/vfstab

reboot -- -sr (reboot w/no takedown options, single user, reconfigure
boot)

if [it worked] then
do
        fsck /usr
        reboot
done
else
do
        insert Solaris CDRom
        boot cdrom -s
        undo /usr /usr2 switch mentioned earlier
done
endif

*REMEMBER:  do not do anything bad to the origional /usr until you are
sure all worked, and have tested the system in multi-user mode.

--
=====================================================
 my opions are mine and do not represent my employer
                         and
                 I have brain damage
                          so
don't take life so seriosly, you won't get out alive!
=====================================================

 
 
 

moving /usr

Post by Scotc » Fri, 16 Oct 1998 04:00:00


Gary,

First of all you don't want to use cp -r it will not keep your permissions
intact etc. instead use:

find . -depth -print | cpio -pdlmv /newdir

Scott R. Haven

Scotch_



Quote:> I have been unsuccessful in booting my Solaris 2.3 machine after moving
/usr
> to a different disk (on another controller) labeled /usr2.  I've tried
> linking /usr to /usr2 but the system still will not boot.  My last
attempt
> will be to make changes to the vfstab (it's more direct) however I need
to
> know how can I change the /usr2 directory to /usr now that the original
/usr
> is gone?.  I'm afraid if I do just a cp -r the links will not be properly
> managed.  I would have to do this from CD-ROM of course.
> Any ideas?.
> Thanks.

 
 
 

moving /usr

Post by Unix Sys Adm » Fri, 16 Oct 1998 04:00:00




> > I have been unsuccessful in booting my Solaris 2.3 machine after moving
> /usr
> > to a different disk (on another controller) labeled /usr2.  I've tried
> > linking /usr to /usr2 but the system still will not boot.  My last attempt
> > will be to make changes to the vfstab (it's more direct) however I need to
> > know how can I change the /usr2 directory to /usr now that the original
> /usr
> > is gone?.  I'm afraid if I do just a cp -r the links will not be properly
> > managed.  I would have to do this from CD-ROM of course.
> > Any ideas?.
> > Thanks.

>    You have really a mess here and you ought to explain exactly how your
> machine is right now before you go any further, from there I am sure you
> will find  sound advice in this newsgroup.

>    Could you please post a copy of you actual /etc/vfstab file as well as
> an explanation of how are /usr and /usr2 configured (is any one of them a
> link, a filesystem, a subdirectory? More details please!)

>   Now, to move FILESYSTEMS you can use this command:

> ufsdump 0f  -  /dev/rdsk/cwtxdysz | (cd /target_dir;ufsrestore xf - )

> where: /dev/rdsk/cwtxdysz is the raw partition where your source
> filesystem is living. Change w,x,y,z as appropiate and if in doubt ask
> first.

> Cheers

> reply:
> Well I was sucessfull in doing the following:  I edited the vfstab /usr2
> entry and changed it to /usr (deleting the original /usr entry) pointing to
> the new slice on my 2nd disk (on c1t1d0s1).  The systme booted!.  What's
> confusing is that I created a /usr2 in root, made an entry in vfstab for
> usr2 to point to c1t1d0s1 then mounted /usr2 and dumped /usr to /usr2.
> Since the system booted, I deleted /usr2 directory (nothing was in it).
> There is no link to /usr2 from /usr.  All this worked but I don't fully
> understand why?

If your system has an /usr directory available it will boot. Most UNIXEs
don't care where the files they need are as long as they are accesible.

What you did changing /usr2 to /usr was to provide a bunch of programs
that your machine needs to do anything useful.

Quote:> Next I formated c0t3d0s6 & 7 and re-arranged the partition sizes and newfs'd
> the 2 slices.  I'm ready to move /usr to the new slice but I'm hesitant to
> do so until I understand why the above worked.
> Included are attachements for vfstab, ls output, mount and df-k output.

   No problem. Just use the command I gave earlier and then edit your
/etc/vfstab to reflect where your /usr is now and then reboot. You should
be up and running in a short time.

Cheers

---------------------------------------------------
To send e-mail please remove the anti-spam and use:
my username: jlms
my mailbox sits in: geocities.com

 
 
 

moving /usr

Post by Gary Ferre » Fri, 16 Oct 1998 04:00:00


Moving the contents of /usr and back was a simple matter of editing the
vfstab.  I guess it did not matter what directory I created to dump /usr
into (/foo ...), vfstab only sees the slice (c0t3d0sx).
Thanks to all who have helped me, I ready to challenge my next task.
 
 
 

1. Consequences of moving /usr/dt, /usr/java1.1, /usr/share

Guys,

I've got a pretty full /usr directory and I could free up a bunch of
space by moving /usr/dt, /usr/java1.1 and /usr/share and creating
appropriate links.  Near as I can tell, there's nothing essential to the
boot up process in any of these directories.

Can anybody think of any other consequences?

Thanks,

BV

--
egrep -v '(celery|broccoli|spinach)' /dev/plate|\
cat - /dev/beer_can|chew|swallow 2>/dev/burp|\
digest 2>/dev/fart >/dev/toilet\
:wq

2. core files

3. Moving /usr, /usr/src to new disk?

4. Appletalk Setup Problems

5. Moving /usr/lpp or subtrees to diff. filesys

6. remove anon_hash_chain

7. Move /usr

8. Need an Xwindows server for a pc

9. can't boot after moving /usr partition/drive

10. Safe way to move /usr, /var

11. Moving /USR to a new partition

12. How to move /usr ?

13. moving /usr to /