From salinjos@nospam.net Wed Nov  4 22:07:55 PST 1998
Article: 147212 of comp.unix.solaris
From: "an U.S.A. (Unix Sys Admin)" <salinjos@nospam.net>
Newsgroups: comp.unix.solaris
Subject: Re: Growing a filesystem
Date: Tue, 20 Oct 1998 12:48:57 +0100
Organization: Merrill Lynch
Lines: 77
Message-ID: <Pine.GSO.3.96.981020124510.11943B-100000@jemima>
References: <37529B089FFA8A4A.A7F25E960EB4CDAD.0DE965B52891708C@library-proxy.airnews.net> <bqh67dfogie.fsf@spam.please>
NNTP-Posting-Host: jemima.uk.ml.com
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Sender: salinjos@jemima
In-Reply-To: <bqh67dfogie.fsf@spam.please>
Path: news1.meer.net!news3.best.com!news1.best.com!feed1.news.rcn.net!rcn!dca1-hub1.news.digex.net!digex!news-peer-east.sprintlink.net!news.sprintlink.net!psinntp!news.ml.com!jemima!salinjos
Xref: news1.meer.net comp.unix.solaris:147212

On 20 Oct 1998, Thomas Tornblom wrote:

> "Olaf" <olaf@texas.net> writes:
> 
> > How do you grow a file system?  This is a standard ufs system created using
> > newfs.  Originally, I partitioned 1gb of a 4gb disk, and did newfs on the
> > slice.  We needed more room so I allocated the whole 4gb to the slice using
> > format.
> > 
> > I understand that
> > 
> > mkfs -G -M /dev/dsk/c0t2d0s0 <other stuff>
> > 
> > will allow me to grow a mounted partition, but what do I need to put in
> > after the device?
> > 
> > Thanks
> > 
> > olaf@texas.net
> > 
> > 
> 
> You need to use:
> /usr/lib/fs/ufs/mkfs
> The argument to "-M" should be the mountpoint of the filesystem.
> The device should be the raw device (/dev/rdsk/c0t2d0s0)
> And "<other stuff>" is the number of blocks.
> Check with "prtvtoc /dev/rdsk/c0t2d0s0" or "format c0t2d0"
> 
> An example:
> 
> From df -k:
> 
> /dev/dsk/c0t1d0s0     963158  905380       0   100%    /cdr
> 
> Lets say I managed to give this more blocks at the end and I want to
> grow the filesystem:
> 
> # prtvtoc /dev/rdsk/c0t1d0s0
> [.....]
> 
> *                          First     Sector    Last
> * Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
>        0      2    00          0   2051280   2051279   /cdr
> -----------------------------------^^^^^^^
>        2      5    01          0   2052288   2052287
> 
> I see that the partition is 2051280 sectors.
> 
> The command line would be:
> 
> /usr/lib/fs/ufs/mkfs -M /cdr /dev/rdsk/c0t1d0s0 2051280
> 
> The "-M" implies "-G". "-G" is used when the filesystem is not mounted.
> 
> I would not try this on the / filesystem while the system is in multiuser.
>

Hold on, hold on! the options you mention are not documented in the man
pages (-M -G) so could you explain what is this all about (do they work
but are they not documented?)

Cheers.

 
> -- 
> 
> Thomas Tornblom          Tel: +46 8 623 9100   E-mail: Thomas.Tornblom@Sun.SE
> Sun Microsystems AB      Fax: +46 8 623 9102
> 
> 

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



From Casper.Dik@Holland.Sun.Com Mon May  3 22:19:32 PDT 1999
Article: 174357 of comp.unix.solaris
From: Casper.Dik@Holland.Sun.Com (Casper H.S. Dik - Network Security Engineer)
Newsgroups: comp.unix.solaris
Subject: Re: Solaris 7, what is /space used for?
Date: 15 Apr 1999 19:50:24 GMT
Organization: Sun Microsystems, Netherlands
Message-ID: <casper.924205312@nl-usenet.sun.com>
References: <371638f8.2761210@newshost.neosoft.com>
NNTP-Posting-Host: room101.holland.sun.com
Mail-Copies-To: never
Lines: 64
Path: news1.meer.net!news3.best.com!news2.best.com!news.maxwell.syr.edu!dispose.news.demon.net!demon!btnet-peer!btnet-feed2!btnet!carbon.eu.sun.com!uk-usenet.uk.sun.com!nl-usenet.holland.sun.com!not-for-mail
Xref: news1.meer.net comp.unix.solaris:174357

[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]

jmcknigh@bindview.com writes:

>I see a /space on my Sol 7 workstation. It seems to have a lot of
>space inside of it. How can I allocate this space to my root
>directory?

>nero% df -k
>Filesystem            kbytes    used   avail capacity  Mounted on
>/proc                      0       0       0     0%    /proc
>/dev/dsk/c0t0d0s0    1984230 1835031   89673    96%    /
>fd                         0       0       0     0%    /dev/fd
>swap                  304184     968  303216     1%    /tmp
>/dev/dsk/c0t0d0s3    6484885       9 6420028     1%    /space


This is actual possible, since you have only two partitions
and we're assuming the root partition is first.

You can only grow the partition, so be careful:

	swap -d <swap partition>
	umount /space
	format
		repartition the disk
		    move swap to the end
		    delete partition s3
		    add the extra space to root
		NOTE THE SIZE OF THE NEW PARTITION IN BLOCKS!!
		label


	run growfs; this is the tricky bit:


	- kill process accounting
	- kill most daemons (syslogd, sendmail, etc)

		have two windows with root.

	 W1# lockfs -w /
		W2# /usr/lib/fs/ufs/mkfs -M /  -G #number of blocks seen above

	the second command will hang at with point you type the following
	in W1#:

		W1#	lockfs -u /


	then reboot.


Worked for me.  You might want to do all this when booted from CD, though.

And you want to have a backup handy.

Casper

--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.


