Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Dec 2006 22:56:41 +0000
From:      Vince <jhary@unsane.co.uk>
To:        Jerry McAllister <jerrymc@msu.edu>
Cc:        Peter Clark <clarkp@mtmary.edu>, freebsd-questions@freebsd.org
Subject:   Re: Extending a slice
Message-ID:  <45789C29.8000707@unsane.co.uk>
In-Reply-To: <20061207215042.GB46531@gizmo.acns.msu.edu>
References:  <4578893F.8050604@mtmary.edu> <20061207215042.GB46531@gizmo.acns.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Jerry McAllister wrote:
>> Hello,
>>
>> I have and existing FreeBSD 5.4 box with 2 6GB hard drives in a RAID 1 
>> mirror using gmirror. Due to physical space restrictions I cannot put 
>> more drives into this box and yet I need more physical drive space. I 
>> have 2 blank 40GB drives to replace my 2 current 6GB drives. I broke the 
>> mirror and inserted one 40GB drive into the mirror and removed the 
>> remaining 6GB drive. So, now I have a 40GB drive with only 6GB's of 
>> space on it and 34GB's of unused space. I have and existing mount point 
>> in the 6GB of space called /data. I would like to extend the slice and 
>> add the 34GB of unused space to the current /data mount point. Does 
>> someone even "extend" an UFS slice? Or do I create a new slice in the 
>> unused section and somehow merge the existing slice's /data with the new 
>> one? Or am I missing something rudimentary? Any direction would be 
>> appreciated.
>>     
>
> If the space was already in a slice and you just wanted to expand
> a partition in to the unused space, then you could use growfs(8), but
> I don't think that will work to expand a slice.
>
>   
To be fair the growfs man page does say
" If you wish
     to grow a file system beyond the boundary of the slice it resides 
in, you
     must re-size the slice using fdisk(8) before running growfs."

I've never tried this but since this is one of a mirrored pair and you 
still have the other mirrow you're in a good position to try it ;)
There is a rather old (example is on 4.4) but i think still valid, 
example here
http://ezine.daemonnews.org/200111/growfs.html

(that said I've never tried it and it could easily hose your system. try 
at your own risk)


Vince
> Really, the easiest thing is to use dump(8) to back up the existing 6 GB. 
> It will be necessary to do a dump for each file system (partition) you
> have in the slice other than swap or /tmp.
>
> Then build the 40 GB disk as needed.   You can best do this from
> a fixit CD.    You will need to make a slice with fdisk, then
> divide that slice into partitions with bsdlabel.   Then for each
> partition except for swap, use newfs to build a file system in them.
> When that is done, make temporary mount points, mount the partitions
> and restore the dumps.   This sounds long and drawn out telling it,
> but it is actually quite easy and works well.
>
> If it is your boot disk, then the fdisk should write the MBR and
> the bsdlabel needs to write the boot sector for the slice.  
> There is a good example of fdisk and bsddlabel use for creating
> a brand new bootable disk with one FreeBSD slice in the bsdlabel
> man page near the bottom.   Also, in the last few days I have 
> posted several replies to questions that would cover this process
> and included extensive examples.    The only difference is that
> they weren't for mirrored disks.  But, it sounds like you got
> rid of the mirror anyway.   
>
> The dump/rebuild/restore is the way to go
> even if you do it to a new mirror of the 40GB drives.  
> Or you could write the dumps to one of the rather than tape
> and restore from that.
>
> ////jerry
>
>
>   
>> Thank You.
>> Peter Clark
>>
>> _______________________________________________
>> freebsd-questions@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>>     
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>   




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?45789C29.8000707>