# New FreeBSD install.  Slices are sized incorrect



## juv123 (Dec 10, 2010)

Hey all,

Newbie admin here.

Just had my server company wipe a server that had been compromised.  Immediately after having the wiped server, I started downloading ports.  Ran out of room on /usr:


```
....
 Checkout ports/www/chtml/pkg-plist
 Checkout ports/www/ckeditor/Makefile
 Checkout ports/www/ckeditor/distinfo
 Checkout ports/www/ckeditor/pkg-descr
 Checkout ports/www/ckeditor/pkg-plist
 Checkout ports/www/cl-lml/Makefile
 Checkout ports/www/cl-lml/distinfo
 Checkout ports/www/cl-lml/pkg-descr
 Checkout ports/www/cl-lml/pkg-plist
 Checkout ports/www/cl-lml-clisp/Makefile
 Checkout ports/www/cl-lml-clisp/pkg-descr
 Checkout ports/www/cl-lml-sbcl/Makefile

/: create/symlink failed, no inodes free
Updater failed: /usr/ports/www/cl-lml-sbcl/#cvs.csup-981.98381: Cannot create: No space left on device
```

Now looking at /etc/fstab I see they don't have /usr on its own slice (thought it did before I had it wiped)

```
# Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/ad4s1b             none            swap    sw              0       0
/dev/ad4s1a             /               ufs     rw              1       1
/dev/ad4s1f             /home           ufs     rw              2       2
/dev/ad4s1e             /tmp            ufs     rw              2       2
/dev/ad4s1d             /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0
```

df -h:

```
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/ad4s1a    989M    774M    136M    85%    /
devfs          1.0K    1.0K      0B   100%    /dev
/dev/ad4s1f    211G     22K    194G     0%    /home
/dev/ad4s1e    4.8G     12K    4.5G     0%    /tmp
/dev/ad4s1d    4.8G     23M    4.4G     1%    /var
```

Now since I just started what can I do?  I really don't need 195G in /home (I assume 150G would be plenty), but am not sure of the steps I need to take...

Thanks for your help!


----------



## DutchDaemon (Dec 10, 2010)

Remove from /usr/ what you possibly can (like /usr/ports), copy /home/ to /usr/home/, edit /etc/fstab, assign /usr to /dev/ad4s1f (replace /home), reboot in single user mode, remove /home, create a symlink in / for /home (symlink /home to /usr/home), and reboot. You should now have a working /usr partition with /home inside it (which is completely normal).


----------



## juv123 (Dec 10, 2010)

DutchDaemon - that is exactly what I needed!  Thank you.

Before I start I have an admin account and no direct login to su.  So I have to login as admin first (which has a home directory of /home/admin) - does this effect your tutorial at all (since the home/admin directory will be moved then rebooted) or does this not matter?


----------



## DutchDaemon (Dec 10, 2010)

Actually, now that I re-read it I'm not so sure this will work. Mounting /dev/ad4s1f on /usr will actually 'cover' your existing (filled) /usr with an empty partition, so you'll have to copy your present /usr to e.g. /var/usr and move things around in single-user mode. There's probably no way to do this without physical access.

I see very little data in use, so if you can organise a re-install with proper partitioning (i.e. with a /usr partition on a proper mountpoint) that would make things way, way easier.


----------



## DutchDaemon (Dec 10, 2010)

If all else fails and you're stuck with how things are now, move /usr to /home/ (creating /home/usr/) and symlink /usr to /home/usr. At least this will provide /usr with the largest partition.


----------



## juv123 (Dec 10, 2010)

Whoa - now I am lost. 

nothing is really being used.  After removing ports, nothing has changed from the install.  What is your suggested method of getting the /usr partition correct?  That setup is what it used to be (/usr/home with /home symlinked to /usr/home)


----------



## juv123 (Dec 10, 2010)

Ack - just saw your last post.  Is it not possible to get /home inside /usr?


----------



## DutchDaemon (Dec 10, 2010)

I don't think you will be able to do the necessary juggling/mounting/unmounting of partitions without running in single-user mode. You can't rename or remove mountpoints on a running system. I don't know what your server company did, but they should be able to install a server with default partitions, i.e. with a regular /usr partition, right?


----------



## juv123 (Dec 10, 2010)

I am with softlayer.  They did an earlier OS reinstall and some error occured with missing the bootloader, and they couldn't get freebsd8 installed - I don't think they are familiar with proper install procedures of freebsd.  So I am not sure they can do it.  Is there something specific I should ask for from them to help?

This is a self-managed server (that I have managed to self-admin for several years)- so they provide no support at all.

If this can be done remotely (reinstall with proper partition sizing) is there someone who will do this for a fee?  I can pay via paypal to get me up and running.  I have to get my sites back up...


----------



## juv123 (Dec 10, 2010)

And I should state that I am just looking to get the partitioning correct - reinstall OS if necessary, asap.  I can take it from there.  My old install had the /home inside /usr (/usr/home) so that would make it easiest for me.  I have no problems paying for the help...


----------

