copying a large filesystem

Hi there

In my organisation we have a solaris network with /home being automounted from /export/home on a central file server (usual stuff) however, the guy who originally set this up only allocated 3gb to /export/home and now we are really struggling for space. I have a new 18gb disk installed on the same box, it has been formatted and is ready to go. My problem is once i make sure everyone is out of their home directory, what would be the best procedure to copy all the data over to the new disk whilst retaining all folder and file permissions and then of course making it live !. I presume that I dont have to worry about it being called /export/home on the file server as i could share it out even if it was called /newhome ?. What changes to NIS would i need to make ? (automount files etc)

Apologies if this sounds dumb, its just that I have to make sure i dont mess it up, as we have production systems running from /home and it HAS to work in the morning

Cheers
Gary

hiho,

i prefer an ufsdump when transfering filesystems from maschine to maschine.....
# ufsdump -f <name> <path>
# ufsrestore <name>

you said the new disk is already in the maschine.... so you could copy the files directly. i would do it this way to keep the permissions:
# mount /dev/dsk/c?t?d0s? /mnt/newdisk
# find /export/home -print -depth | cpio -pdmu /mnt/newdisk

you don't need to change any shares, because now you could mount the "newdisk" to /export/home
# umount /export/home ; mount /dev/dsk/c?t?d0s? /export/home
fix your entry in /etc/vfstab and everyone can work unconsciously.

greetings Pre�y

As far as the NIS part of your question - if you wanted to bring the one drive up and push users over to it - you would want to change the auto_home map
I moved from a Network Applicance server to a SUN E450 for home directories -
Original map:
-bg,soft,intr toast1.my.com:/vol/home0/home/jfneal
-bg,soft,intr toast1.my.com:/home/&

Final map:
-bg,soft,intr toast1.my.com:/vol/home0/home/jfneal
-bg,soft,intr toaster.my.com:/home1/&

Note that the server changes from toast1 to toaster and /home to /home1. This left all the 'old' home directories intact so I had an on-line backup on the old system. Even if your disk is on the same system you can leave it around for awhile in case users aren't off completely. I moved them during the day and the only ones I had a problem with were the ones that normally never log out (developers and SAs).
{For all of you about to say I should have waited - this was brought about due to upper management stating "You will move out of this building by the end of the week". It actually went pretty smooth considering they had no concern for our problems for doing it - and of course we got big raises and bonuses for our hard work...they just seem to have gotten lost in the mail - but they saved their millions in rent - I bet they got bonuses!}.

This is what I would do (not that the other recommendations wouldn't work).

  1. Create a filesystem on the new disk, maybe call it newhome.
  2. Make sure everyone is logged out and stop sharing the current home directory.
  3. Use this tar command to copy everything:

tar cvfp - /export/home/* | (cd /newhome; tar xvfp - )

You may have to adjust the paths and may not want to use the 'v' option on the tar commands. I like the v so I can see the progress.

  1. Share the newhome as /export/home.

I use this often when moving files between filesystems on the same system. We have 1 filesystem shared out as a home directory per group in combination with NIS. We often have people change groups which requires us to move their home directory to a different share. I just make sure they log out, rename their original home directory, move it with tar, update their passwd entry, push the changes, and they are ready to go.