Skip to main content

FreeBSD: How to Resize Root Partition



Set debugflags

sysctl kern.geom.debugflags=16

Resize root partition

Show the current partition


gpart show
=>     40  8388528  da0  GPT  (30G) [CORRUPT]
       40     1024    1  freebsd-boot  (512K)
     1064  7965696    2  freebsd-ufs  (3.8G)
  7966760   421808       - free -  (206M)
  

Apply the partition

/etc/rc.d/growfs onestart

Growing root partition to fill device
Adding swap partition
da0 recovered
da0p3 added
da0p2 resized
super-block backups (for fsck_ffs -b #) at:
 8963328, 10243776, 11524224, 12804672, 14085120, 15365568, 16646016, 17926464, 19206912, 20487360, 21767808,
 23048256, 24328704, 25609152, 26889600, 28170048, 29450496, 30730944, 32011392, 33291840, 34572288, 35852736,
 37133184, 38413632, 39694080, 40974528, 42254976, 43535424, 44815872, 46096320, 47376768, 48657216, 49937664,
 51218112, 52498560, 53779008, 55059456, 56339904
Metadata value stored on da0p3.
Done.

Check the result

df -h
Filesystem         Size    Used   Avail Capacity  Mounted on
/dev/gpt/rootfs     26G    2.2G     22G     9%    /
devfs              1.0K      0B    1.0K     0%    /dev


Change back the debugflags


sysctl kern.geom.debugflags=0

Swap partition

If you've swap partition, please remove it before resize the root partition.

Comments

Popular posts from this blog

:: wordpress theme reset to default

:: whatis wordpress WordPress is an open source CMS, often used as a blog publishing application powered by PHP and MySQL. It has many features including a plugin architecture and a templating system. -[ http://en.wikipedia.org/wiki/Wordpress ]- :: reset themes wordpress to default # with cli [ linux: ~ ]$ mysql -u user -p mysql> use dbwordpress; mysql> UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template'; mysql> UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet'; # share hosting / cpanel / phpmyadmin 0. login on cpanel / phpmyadmin 1. select db for wordpress 2. select SQL tabs and run this command: UPDATE wp_options SET option_value = 'default' WHERE option_name = 'template'; UPDATE wp_options SET option_value = 'default' WHERE option_name = 'stylesheet'; 3. click GO 4. open your site, if you still get blank screen, you can login on admin page ...

:: solution for libtoolT error

:: what is please take a look at this. :: case /bin/rm: cannot remove `libtoolT': No such file or directory if you get some error message like that when you compiling some application from source you can do like this for resolve on it. :: solution this example for resolve on compiling mysql package. install libtool packages from repository and run liboolize command line on the package: linux:~/download/mysql-5.1.37 # yum install libtool linux:~/download/mysql-5.1.37 # libtoolize --force linux:~/download/mysql-5.1.37 # autoconf and/or linux:~/download/mysql-5.1.37 # autoreconf after that you can recompile and install your package from source. :: links + GoogleLinux

:: How to Recompile Nginx in Ubuntu

  Recompiling Nginx on Ubuntu can be a crucial task for those who need to customize their web server to meet specific requirements. Whether you need to add new modules, optimize performance, or apply patches, recompiling Nginx allows you to tailor the server to your needs. This guide will walk you through the process step-by-step, ensuring you have a smooth and successful recompilation.   Understanding the Need for Recompilation Why Recompile Nginx? Recompiling Nginx is often necessary when you need to add or remove modules that are not included in the default package. For instance, if you need to integrate a third-party module for enhanced security or performance, recompilation is the way to go. Additionally, recompiling allows you to apply custom patches or optimizations that can significantly improve your server's efficiency. Benefits of Custom Compilation Custom compiling Nginx offers several advantages. Firstly, it provides greater control over the server'...