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!

move /var to new file system

Status
Not open for further replies.

shatnawi

Technical User
Dec 15, 2009
4
0
0
JO
Hi all ... hope all going will with you

OS : solaris 10
/var in my system is under / , and I want to move it to new file system , i appended new line in the /etc/vfstab file as the follwing
/dev/dsk/c2t1d0s0 /dev/rdsk/c2t1d0s0 /var ufs no yes -
when I rebooted the system the following message appeared
svc:/system/filesystem/minimal:default failed to mount /var

can anyone help me ... thank in advance
 
Have you created a filesystem on /dev/dsk/c2t1d0s0? Did you migrate the data from your existing /var directory on to the new filesystem?

Simply mounting it over the top of the old /var is not enough... it would also mean that no space would be released on your existing / filesystem because the old /var data would still be there, but hidden under a mount point.

Annihilannic.
 
assuming you have mirrored root drives.

the easiest way would be to break the mirror, repartition one of the disks to fit your necessary sizes and then do a live upgrade on to that new disk.


 
1. Boot in single user from a cd
Insert cd
boot cdrom –s

2. Mount your root file system.
I will assume that is /dev/dsk/c1t1d1s0.
mount /dev/dsk/c1t1d1s0 /a

3. Create a new file system for /var
format
Select the disk you want to use.
Create a partition of the size you want.
I’m going to assume that is /dev/dsk/c1t1d1s3
Remember to label the disk.

4. Create a new file system on the /var disk slice.
newfs /dev/dsk/c1t1d1s3

5. Mount the new var partition (anywhere will do)
mount /dev/dsk/c1t1d1s3 /b

6. Copy the data in the old var directory to the new var file system.
cd /a/var; tar cf - .| (cd \b; tar xfBp -)

7. If you are sure everything has copied over to /b, delete your old data.
/bin/rm –r /a/var/*
Keep the directory /a/var.
This is the mount point for the new file system

7. Edit /etc/vfstab on your root partition.
This is mounted on /a.
vi /a/etc/vfstab

The entries for root and var will look something like this:

/dev/dsk/c1t1d1s0 /dev/rdsk/c1t1d1s0 / ufs 1 no -
/dev/dsk/c1t1d1s3 /dev/rdsk/c1t1d1s3 /var ufs 1 no -

8. Cross your fingers.

9. Reboot on the original root file system.

10. df –k to check. You should see something like this:

/dev/dsk/c1t1d1s0 20646121 5524089 14915571 28% /
/proc 0 0 0 0% /proc
mnttab 0 0 0 0% /etc/mnttab
fd 0 0 0 0% /dev/fd
/dev/dsk/c1t1d1s3 10332460 651767 9577369 7% /var
swap 14901952 192 14901760 1% /var/run
swap 14907168 5408 14901760 1% /tmp
etc

Good luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top