DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 23rd August 2020
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default Grow a partition

This :
Code:
parrot$ df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sd0a     1005M   1005M  -50.0M   105%    /
/dev/sd0k      797G    429G    328G    57%    /home
/dev/sd0d      3.9G    4.7M    3.7G     0%    /tmp
/dev/sd0f      2.0G    1.0G    882M    54%    /usr
/dev/sd0g     1005M    223M    732M    23%    /usr/X11R6
/dev/sd0h     19.7G    5.1G   13.6G    27%    /usr/local
/dev/sd0j      5.9G    2.0K    5.6G     0%    /usr/obj
/dev/sd0i      2.0G    2.0K    1.9G     0%    /usr/src
/dev/sd0e      7.6G    572M    6.7G     8%    /var
Speaks for it's self. One time , along time ago I did successfully grow my "sd0k" /home partition, it was fairly simple. But I have forgotten exactly how, and also the sd0a / partition is different. I do know there is info in the FAQ, and also 'man fdisk', etc. How ever, I am really not in very good health at all, and would appreciate if any one can give me a straight forward , step by step. Mostly to confirm if what I think is best.
My thoughts are to shrink, or take from sd0k /home, aprox 2g and then grow sd0a / adding 2g to it, ...
Thank you
__________________
My best friends are parrots
Reply With Quote
  #2   (View Single Post)  
Old 23rd August 2020
shywren shywren is offline
New User
 
Join Date: Aug 2020
Posts: 4
Default

Normally, the root partition shouldn't fill up, and being full indicates that something has gone wrong. Which is to say... do you know why / has ended up this way? On my -current system, df -h returns the following for the root partition:

Code:
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sd0a     1005M    126M    829M    13%    /
Full root partitions occasionally come up on the mailing lists, though I'm having trouble finding the threads I'm thinking of at the moment. One thread I did manage to find suggested that a dd gone wrong is a common cause of a full /, though I think I've also seen other explanations in the past. This might be a better place to start, especially given that... resizing partitions on OpenBSD is *not* trivial, and a fresh install is the general rule of thumb, iirc.
Reply With Quote
  #3   (View Single Post)  
Old 23rd August 2020
Head_on_a_Stick's Avatar
Head_on_a_Stick Head_on_a_Stick is offline
Real Name: Matthew
Bloaty McBloatFace
 
Join Date: Dec 2015
Location: London
Posts: 220
Default

The sysutils/ncdu package is very useful for analysing disk usage.
__________________
Linux is for people who hate Windows. BSD is for people who love UNIX.
Reply With Quote
  #4   (View Single Post)  
Old 23rd August 2020
fvgit's Avatar
fvgit fvgit is offline
Spikes in tights
 
Join Date: May 2016
Location: perl -MMIME::Base64 -le 'print decode_base64("U2hlcndvb2QgRm9yZXN0")'
Posts: 281
Default

In any case growfs(8) and disklabel(8) are your tools to grow a partition on OpenBSD:

Code:
     The growfs utility extends the newfs(8) program.  Before starting growfs,
     the partition must be set to a larger size using disklabel(8).  The
     growfs utility extends the size of the file system on the specified
     special file.

     Currently growfs can only enlarge unmounted file systems.  Do not try
     enlarging a mounted file system - your system may panic and you will not
     be able to use the file system any longer.  Most of the newfs(8) options
     cannot be changed by growfs.  In fact, you can only increase the size of
     the file system.  Use tunefs(8) for other changes.

(...)
Reply With Quote
  #5   (View Single Post)  
Old 23rd August 2020
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default

Quote:
shywren > Normally, the root partition shouldn't fill up, and being full indicates that something has gone wrong.
I know, that is something else that has me worried about this, no I don't know why, it is a surprise.

Quote:
. resizing partitions on OpenBSD is *not* trivial, and a fresh install is the general rule of thumb, iirc.
Well, it depends, years ago I needed to grow the /home partition, and it was not very difficult, but like I said , I don't remember much about it, however being that this is sd0a / , it may not be trivial,
I noticed it because I had wanted to install "cmake", and it could not install:
Code:
parrot$ su
Password:
parrot# pkg_add cmake
quirks-3.325 signed on 2020-08-21T22:26:57Z
|No change in quirks-3.325
cmake-3.16.2p1v0:libuv-1.30.1: ok
Error: /dev/sd0a on / is not large enough (/etc/rhashrc)
/dev/sd0a on /: 523 bytes (missing 102378 blocks)
/dev/sd0h on /usr/local: 2347692 bytes
cmake-3.16.2p1v0:jsoncpp-1.8.4p2: ok
Can't install cmake-3.16.2p1v0: can't resolve rhash-1.3.9
Couldn't install cmake-3.16.2p1v0 rhash-1.3.9
parrot#
__________________
My best friends are parrots
Reply With Quote
  #6   (View Single Post)  
Old 23rd August 2020
PapaParrot's Avatar
PapaParrot PapaParrot is offline
parrot
 
Join Date: Jul 2015
Location: Durango, Mx.
Posts: 472
Default

Thanks, I looked at the thread on the mailing list, all though I still do not know how it got that way, I did fix it , at least for now:
Code:
parrot$ su
Password:
parrot# find -x / -size +10000 -exec du -h {} \;
17.8M   /bsd
9.9M    /bsd.rd
886M    /mnt/tempfile
17.7M   /bsd.sp
17.8M   /bsd.booted
9.8M    /bsd.rd-6.5
parrot# cd /mnt
parrot# ls
tempfile
parrot# cd tempfile
ksh: cd: /mnt/tempfile - Not a directory
parrot# rm tempfile
parrot# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/sd0a     1005M    118M    836M    12%    /
/dev/sd0k      797G    429G    328G    57%    /home
/dev/sd0d      3.9G    6.5M    3.7G     0%    /tmp
/dev/sd0f      2.0G    1.0G    884M    54%    /usr
/dev/sd0g     1005M    223M    732M    23%    /usr/X11R6
/dev/sd0h     19.7G    5.1G   13.6G    27%    /usr/local
/dev/sd0j      5.9G    2.0K    5.6G     0%    /usr/obj
/dev/sd0i      2.0G    2.0K    1.9G     0%    /usr/src
/dev/sd0e      7.6G    572M    6.7G     8%    /var
parrot#
Thanks


Edit: Now I remember, I did run a 'dd' command, and that is what created the "886M /mnt/tempfile",
so it was a dd command gone bad,...dummy me, I will blame the medications for it.
And thanks again, including every one that responded.
__________________
My best friends are parrots

Last edited by PapaParrot; 23rd August 2020 at 10:03 PM. Reason: now I remember
Reply With Quote
  #7   (View Single Post)  
Old 23rd August 2020
shywren shywren is offline
New User
 
Join Date: Aug 2020
Posts: 4
Default

Ah, wonderful! I'm finding it challenging to think of just the right search terms to use on marc.info to get more on this (as I cannot for the life of me remember the contexts in which I've seen lots of discussion about this very topic in the past; maybe syspatch?), so it's good to know I can stop digging
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenBSD foundation, how can it grow? psypro OpenBSD General 3 14th August 2016 09:48 AM
add another partition? amandus FreeBSD General 2 11th June 2013 02:51 PM
Boot in other partition dgiorgio OpenBSD Installation and Upgrading 13 20th June 2012 11:07 PM
Anti-Internet Explorer 6 protests grow with online petition (UK) J65nko News 3 2nd February 2010 08:49 PM
Cannot activate partition in XP. bsdnewbie999 OpenBSD Installation and Upgrading 6 4th May 2009 05:21 PM


All times are GMT. The time now is 04:37 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick