|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
||||
Change the Size of a Slice
Quick question:
I imagine many of you knew the answer to my question just after looking at the title of my topic, but here it is: Is it possible to increase the size of a FreeBSD slice? It seems to me the obvious answer should be yes, but I have not really found any way to do it. The closest I got was when I was tinkering around with parts of fdisk I have never used (Not from sysinstall), but it appeared I was editing nothing more than configuration files. Either way, I have not found a definitive answer saying that it IS or is NOT possible, so I would like to know what the case is. Please note that I do mean slice and not partition, as is described in the FreeBSD handbook: http://www.freebsd.org/doc/en/books/...anization.html |
|
||||
Quote:
back it up resize it in fdisk modify the label in disklabel/bsdlabel growfs the file systems as necessary. Note, I ain't never done it and don't plan on doing it anytime this century ^_^.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
fdisk can be used to resize slices. (actually it is same as creating new slice table)
bsdlabel can be used to resize bsd labels, and growfs can be used than to "fix" already presented file systems on resized label (so you do not need to backup data and recreate fs with newfs). Beware that growfs is used only for labels with increased size, labels with decreased size are broken already - possibility of losing data is highly present - which can be fixed only with newfs. If you plan to increase slice over some other one, you must backup (at least) data on slice which is going to be decreased in size. After first slice get increased in size, use "bsdlabel -e" to edit labels. When editing labels, you should only increase last label size(keeping all offsets same) and use growfs only on that one (last label) - there is no utility that change label offset and at same time keep/change its size. Of course you can edit labels as you like but I'm 100% sure that decreased labels can be malfunctioning (I never tried this) and increased labels will semi work (some files will not be accessible) until growfs is used on that label(or until newfs recreate fs - loosing any previous data). So answer is something like no/yes,if you care for your data, otherwise anwser is always yes . Depends if you are interested in not recreating fs(/not using backup) on increased last label of increased slice. Solution for decreased slice(with labels) should always be backup. Of course if you increase slice and do not edit table of labels on that slice, nothing will got wrong with (that)slice - but you will lost usefull disk space. I hope that it's not so complicated to understand what I written. (if you use only one label it becomes very simple) Whatever you do, always make backup. Last edited by richardpl; 24th June 2008 at 11:15 AM. |
|
||||
i don't know for sure but i think that won't do.
how about: 1. Resize the slice using 'fdisk' 2. run 'bsdlabel -e' and then: 3. change the 'c' partition to the new size. 4. add a new partition to use up the extra space 5. add this new partition to the zfs pool (zpool add). |
|
||||
Quote:
What I did last time is took out the disk and put it in another system. Doesnt sound an elegant solution really, then I realize I could do it with the FreeBSD CD but havent had a chance to try it out
__________________
The power of plain text? It can control an entire OS |
|
||||
Yes, I think I would have to do this in single user mode. That should make the root partition no longer a problem because the system can do its usual boot without the root partition. Because ZFS does not have boot support yet, the only way around that is to keep a UFS partition with all of the needed information to do a successful boot without the ZFS partition.
I might end up doing this using a FreeBSD install disk anyway because I have empty space in front of my root partition and behind my ZFS partition. I have no desire to enlarge the root partition, so I will have to copy the partition and then recreate it at the front of the disk. Then I will have to delete and recreate the swap partition, and then I would be able to enlarge the ZFS partition both to the right and to the left of the disk. ephemera, I think your method makes more sense when using ZFS, but I have some questions: Quote:
boot: ar0s2a swap: ar0s2b ZFS (Everything else): ar0s2d Therefore, I suppose by the c partition you just mean the ZFS partition? If I understand this correctly, after enlarging the ZFS partition, I would then create a new ZFS pool to fill the empty space within the enlarged parition. Then I could merge that new ZFS pool with the all ready existant one, which would leave me with a partition completely filled by the ZFS filesystem. Whew! I suppose that should work, but I wonder how I am going to tell ZFS the exact location within the partition to begin and end the new pool. I will have to look into some documentation on ZFS's tools. |
|
|||
Quote:
|
|
||||
Quote:
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Moving linux partitions out of the BSD disklabel/slice | fbsduser | NetBSD Installation and Upgrading | 5 | 4th March 2009 07:07 AM |
CLI font size | idefix | FreeBSD General | 3 | 7th February 2009 11:19 AM |
Negative partition size? | giga | FreeBSD General | 1 | 2nd January 2009 09:02 PM |
Backup getting too big, how to estimate the size after thinnig out? | PatrickBaer | FreeBSD General | 9 | 24th July 2008 12:59 PM |
apache fd size problem | oxy | FreeBSD Ports and Packages | 0 | 10th May 2008 10:49 AM |