Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I move /usr and symlink to it?

Status
Not open for further replies.

DylAtHome

Programmer
Nov 2, 2001
3
0
0
US
I'm very new to Solaris and only slightly less new to Unix in general. Be gentle. :)

I installed Solaris 8 on this used Sparc that my employer picked up for me to play around with. I didn't change the default partition or filesystem layout when I installed it and now I find myself with a root filesystem that is out of space and this huge /export/home area that I'll never fill. I've got the box working like I need it to and I really, really don't want to have to start over. Can I move /usr to /export/home and then create a symbolic link to it?

This is what I was thinking of doing:

cp -rp /usr /export/home/
mv /usr /usr.old
ln -s /export/home/usr /usr

If things continued to work after I did this I would eventually remove /usr.old.

This seems too simple - will it work? I've already destroyed things once because I don't know what I'm doing. I'd rather not do it again. ;)

If that process above will work, how can I get myself into some sort of minimal, command line, single user mode. Does it matter if all of the system services have started?

Thanks very much for any help.

-Dylan


 
are there any free slices on your disk or is /export/home taking up all the remaining space?
 
The Solaris Management Console lists a large partition used for "backup" that isn't mounted. If this isn't required by the OS then I don't mind using it. If I feel this machine needs to be backed up I think I can find better ways then losing half my disk space.

-Dylan
 
that partition is the entire disk if you mounted /dev/c0t0d0s2 it would be a partition the size of the entire disk
 
Ah, I see. I guess if I'd noted the cylinder range I would have realized that. Thanks.

So then, no, I don't have any unused partitions. I just have the mostly unused space mounted as /export/home.

Will my procedure above work? Alternatives?

Thanks.

-Dylan


 
I ve never done it that way ( sym link)

If you have a backup you could wipe out /export/home
recreate it as the size you need and restore. create an additional partion for /usr

make the partition the appropriate size
newfs the cXtXdXsX
mount that partition as /usr.new
copy /usr into /usr.new
cd /usr
find . -depth |cpio -pvdum /usr.new
edit your vfstab file and change the entry for /usr to use the new device /dev/dsk/cXtXdXsX and/dev/rdsk/cXtXdXsX
reboot
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top