Creating New Filesystem /usr

Creating New Filesystem /usr

Post by Kev Mile » Wed, 09 Jan 2002 19:50:46



If I have a Solaris 8 server that has /usr locally on the / partition and I want
to use
some free space on the disk to create a /usr partition - how do I do this and
have the
contents of the / partitions /usr copied to the /usr partition?

Is it just a case of creating the new partition within the "format" command,
adding an entry
in /etc/vfstab, and cpio'ing the files to the new /usr - my worry is there will
be two /usr paths.

Kev

 
 
 

Creating New Filesystem /usr

Post by Chris Thomps » Wed, 09 Jan 2002 20:59:42




Quote:>If I have a Solaris 8 server that has /usr locally on the / partition and
>I want to use some free space on the disk to create a /usr partition - how
>do I do this and have the contents of the / partitions /usr copied to the
>/usr partition?

Are you sure this is what you want to do? What else is in the root filing
system at the moment? It might well be better to pick something other than
/usr to move, as it's not exactly the easiest choice.

However, if you are sure, read on ...

Quote:>Is it just a case of creating the new partition within the "format" command,
>adding an entry in /etc/vfstab, and cpio'ing the files to the new /usr - my
>worry is there will be two /usr paths.

1. Make the new partition with "format", and build a new filing system
   in it with "newfs". Then mount it as "/mnt" (say).
2. Copy the contents of /usr to /mnt. You could use cpio as you suggest,
   although personally I would rather use a ufsdump | ufsrestore pipe.
   You can probably do this part during normal running, as the contents
   of /usr will not be changing.
3. Boot single-user. Add the new partition to /etc/vfstab as /usr.
4. Scary bit: "mv /usr /usr.old" and "/sbin/mount /usr". (You are
   temporarily without /usr/lib there, so need to use a statically
   linked mount program. Be prepared to boot from CDROM to sort
   things out if you make a mistake.)
5. Test a few things, then reboot multi-user.
6. If everything works, and after you have taken backups of the new
   filing systems, you can "rm -r /usr.old" to recover the space in
   the root filing system.

Chris Thompson
Email: cet1 [at] cam.ac.uk

 
 
 

Creating New Filesystem /usr

Post by Chris Thomps » Thu, 10 Jan 2002 02:14:38


[... snip ...]

Quote:>4. Scary bit: "mv /usr /usr.old" and "/sbin/mount /usr". (You are
>   temporarily without /usr/lib there, so need to use a statically
>   linked mount program. Be prepared to boot from CDROM to sort
>   things out if you make a mistake.)

Well, I hope you took account of the warning, because of course that
prescription won't work!  :-(

In the absence of a statically linked mkdir, you could use:

   mkdir /usr.new
   mv /usr /usr.old
   /usr.old/sbin/static/mv /usr.new /usr
   /sbin/mount /usr

*provided* that you have the statically linked utilities (package SUNWsutl)
installed. Or, rather more ugly and awkward to recover from:

   mkdir /usr.old
   mv /usr/* /usr.old
   /sbin/mount /usr

Or you could just hide the old /usr contents by mounting over the top
of them, and then when it came to be time to remove them use the NFS
trick to get at them [see several old postings in comp.unix.solaris].

And of course, you *could* always boot from CDROM instead. I've found
that how the extreme the contortions I go to to avoid doing that depends
a lot on how fast the CDROM drive is ...

Chris Thompson
Email: cet1 [at] cam.ac.uk

 
 
 

Creating New Filesystem /usr

Post by Kev Mile » Fri, 11 Jan 2002 00:32:12


wot about resizing a partition to make space for a new partition
I've tried with a colleague on a test system and the resizing
causes the resized partition to not mount properly - fsck problems

 
 
 

Creating New Filesystem /usr

Post by Darren Dunha » Sat, 12 Jan 2002 07:17:28





>> wot about resizing a partition to make space for a new partition
>> I've tried with a colleague on a test system and the resizing
>> causes the resized partition to not mount properly - fsck problems

> Resizing a partition requires a volume manager be running.

Huh?  You can resize a partition with 'format' or 'fmthard' just fine.
Now that all by itself probably won't do anything useful, but it does
work.

At a minimum, if you have a filesystem on the partition, you'd have to
enlarge it to make use of the new space.

--

Unix System Administrator                    Taos - The SysAdmin Company
Got some Dr Pepper?                           San Francisco, CA bay area
          < How are you gentlemen!! Take off every '.SIG'!! >

 
 
 

Creating New Filesystem /usr

Post by Kev Mile » Sat, 12 Jan 2002 19:28:31


What I have done is take a 6.3Gig partition /export/home,
unmount /export/home
go into format and halve the size of /export/home
use the remaining cylinders to create a new partition /usr
run newfs -Nv on /export/home and /usr raw disk name
then tried to reboot- this fails as it complains about fsck problems
with /export/home
 
 
 

1. Creating a new filesystem in a new partition

Greetings all,

     I have 3 gigs of freespace on my 12 gig HD.  I would like to
partition this space and make it available to both my Red Hat 6.1 OS and
my Win98 OS.  Therefore, it has to be a FAT32 filesystem. I can't use
fdisk in windows to do this because it doesn't recognize linux.  In
other words, windoze fdisk shows 5 gigs of free space when this is
definately not true, linux is taking up 2 gigs. I don't want to use the
win fdisk in fear of it screwing up my linux system. Cfdisk in linux
shows the proper HD setup with the correct amount of freespace, so I
would like to use this program.  My question, however, is which type of
filesystem  should I format the drive in?..it doesn't seem to write
FAT32 filesystems, only FAT16 versions.  Can I choose any FAT16 version
and write that filesystem so that windoze recongnizes it, and then
reformat the partition (new win drive) into a FAT32 from inside windoze?
How should I go about accomplishing this task without screwing anything
up?  Any help is greatly appreciated.

I thank everyone who helps in advance = )

2. trival but annoying redhat problems

3. Diamond Speedstar A55?

4. Creating New Filesystem

5. jdk1.1.5 + Linux --Grrrr...

6. Create a new filesystem

7. Help! my Solaris 8 install cd broke in half

8. Creating new filesystem on assigned partition?

9. HOW DO YOU REMOVE FILESYSTEMS & CREATE THEM ON NEW DISKS?

10. Help - create new filesystem

11. New: Filesystem test creating kernel BUGs at include/asm/spinlock.h

12. How can I separate root filesystem and /usr filesystem