Subscribe to the RSS Feed

 

Grow FreeBSD UFS filesystem on VmWare HDDs

In this artice I’m going to show you how to expand your UFS filesystem under FreeBSD that runs in a Vmware Virtual Machine.

FreeBSD uses slices instead of traditional PC partitions. To sum it up shortly, it means that your whole disk contains only a single traditional partition with the partition type ‘freebsd(165)’. Inside this partition you will have slices. In a typical FreeBSD installation you have seperate slices for /, /usr, /var, /tmp and swap. In most cases the last slice on the partition is the /usr, and hopefully this is the one we have to extend, because in this case the only thing needed is to add some space to the end of the drive and extend the last slice. Sounds easy? Don’t think so!

The main steps are:

  1. Increase the actual (virtual) hdd size
  2. Extend the partition to cover the whole disk
  3. Extend the size of the last slice to cover the whole partition
  4. Extend the actual UFS filesystem on the newly modified slice

All the details:
First, forget livecds like gparted-live, knoppix, other partition hacking tools because they will not work.

Posted 2009/11/30 07:31 by jos


Comments

  1. Jun 14, 09:46 AM

    BMac Says:

    I followed your instructions exactly. Did the calculations you recommended and intentionally made it larger to see if fdisk would correct the value (to verify my calculations) and it was correct. I edited the disk label as instructed and it matches the values from fdisk -s (I verified that the fdisk -s size values matched the raw size in bsdlabel on two other FreeBSD machines and they did) however.. growfs STILL will not grow….

    # growfs /dev/da0s1f
    GEOM_LABEL: Label ufsid/4b60blahblah
    growfs: we are not growing (3204711->3204711)
    GEOM_LABEL: Label for provider da0s1f is ufsid 4b60blahblah

    #

    any advice?

  2. Sep 16, 06:30 AM

    Anesti Bubulya Says:

    I had to boot into single user mode to run fdisk -u to change the geometry of the partition. I actually moved the files onto a backup slice. Then I had to boot using a boot CD/Floppy to make changes to the slice in question. I deleted the slice I was trying to grow, then created the slice again and moved all the files back. Cumbersome, but it worked.

  3. Sep 17, 11:11 AM

    Alexey Says:

    Could you please expand the step
    1.First the line where it says do not edit…
    2.To get the new size…

    What was before and what was after (bsdlabel screenshots). Thank you

  4. Feb 14, 04:52 PM

    David Basquin Says:

    In case one get stucked at bsdlabel step, this might be helpful…

    Before I found this article, I was having a hard time with bsdlabel. Even though my /tmp and /usr were mounted, I was unable to write changes.

    So I ended up using another /tmp mount point by creating a specific file system in physical memory (#mdmfs -M -S -s 100m md /tmp). Problem solved.

  5. May 18, 04:12 AM

    luxury Bally bags Says:

    Articles are moving every reader with heart, and full of appeal. Let us have to admire, thank your article!

  6. May 23, 03:48 AM

    D & G handbags wholesale Says:

    Thank you! I LOVE this. I made one. I use it all the time. I will be posting a picture of mine and providing a link on my blog.

  7. Nov 23, 04:25 PM

    Ihor Kaharlichenko Says:

    On FreeBSD-8.2 I get Operation not permitted from bsdlabel. In order to resize the /ad0s1f partition I used gpart:

    # gpart resize -i 6 /dev/ad0s1

    By default gpart resize makes the partition occupy all the available space saving you from messing with bsdlabel calculations. The parameter to -i flag is the index of the partition in the slice being edited (6 for f )and can be taken from gpart list output.

  8. Mar 10, 07:52 AM

    crystal case for iphone 4 Says:

    I amazed with the research you made to make this actual put up amazing. Wonderful task!

  9. Apr 20, 01:52 PM

    Xosa Says:

    Simply and powerfull. Some kind of this info must be put in the handbook. The world virtualize all resources.

  10. Oct 17, 04:08 AM

    Maria Welborn Says:

    In freebsd 9.0 you can make the first (partition) resize step slightly easier by doing gpart resize -i 1 /dev/da0
    (gpart is a BSD base system utility and should not be confused with gparted, they are unrelated. See the man page)
    replace the 1 with your partition number if not the first partition and you would use /dev/ad0 if you have IDE/SATA disks and not SCSI. If you don’t want to resize to fill the disk -s will let you specify the size but growing to fill the whole disk is default. The manual disklabel step is unfortunately still needed.

  11. Dec 22, 10:06 AM

    Andrew Azarov Says:

    It’s not necessary to use this nowadays.
    From Freebsd 8.3 (or you can just boot live cd of bsd 9) you can do
    gpart show (remember the extendable partition)
    gpart resize -i index_of_partition geom
    gpart resize -i index_of_partition geom_slice
    growfs geom_slice_partition

  12. Jan 23, 06:47 PM

    Delois Rothamel Says:

    For latest news you have to pay a quick visit internet and on web I found this web page as a finest site for latest updates.

  13. Feb 28, 04:54 PM

    Milo Says:

    Your blog was interesting. You seem very knowledgeable in your field. dd1

  14. Mar 9, 08:54 AM

    visit the following page Says:

    Pretty! This was an incredibly wonderful post. Thank
    you for supplying this info.

  15. Mar 12, 03:16 AM

    best gps running watches for women reviews Says:

    I simply had to thank you so much once more. I do not know the things I might have carried out in the absence of the thoughts shared by you about this
    question. It absolutely was a challenging crisis for me personally, however ,
    taking a look at your professional tactic you resolved it forced
    me to jump over contentment. Now i am thankful for the guidance
    and hope that you know what a great job that you are getting into training other individuals by
    way of your site. More than likely you haven’t come across any of us.

  16. Mar 24, 10:55 PM

    Anatomy and Physiology Quizzes Says:

    all the time i used to read smaller posts that also
    clear their motive, and that is also happening with this piece of writing which I am reading at this place.

  17. Mar 26, 07:38 PM

    fast cure for yeast infection Says:

    Thanks to my father who told me concerning this website, this website is really amazing.

  18. Apr 10, 04:56 AM

    colonic hydrotheraphy Says:

    Hello! I just wanted to ask if you ever have any trouble with hackers?

    My last blog (wordpress) was hacked and I ended up losing
    many months of hard work due to no back up. Do you have any solutions to stop hackers?

  19. Apr 18, 12:00 PM

    reduce weight Says:

    Heya! I just wanted to ask if you ever have any problems with hackers?

    My last blog (wordpress) was hacked and I ended
    up losing several weeks of hard work due to no data backup.
    Do you have any methods to protect against hackers?

  20. May 3, 02:05 AM

    Http://www.Ocseocompany.Com Says:

    Have you ever thought about publishing an ebook or guest authoring on other sites?
    I have a blog centered on the same information you discuss and would really like to have you share some stories/information.

    I know my subscribers would value your work. If you’re even remotely interested, feel free to shoot me an email.

  21. May 3, 06:55 PM

    www.onlinedatingpromocodes.com Says:

    As the admin of this website is working, no doubt very shortly it will be well-known,
    due to its quality contents.

  22. May 15, 04:18 PM

    economic-geography.org Says:

    Hello There. I found your blog the use of msn. This is a very neatly written article.
    I’ll be sure to bookmark it and return to learn extra of your useful information. Thank you for the post. I will certainly comeback.

Leave a Comment

Add your comment. Preview then Submit.


Hidden


Textile Help