DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Installation and Upgrading

OpenBSD Installation and Upgrading Installing and upgrading OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Lightbulb Resizing /usr

Hi,

I've OpenBSD 4.8 i386 installed on my multiboot box on wd1.

Here is my slice geometry in MB-

Quote:
a - / - 4096
b - swap - 2048
d - /usr - 2048
e - /tmp - 2048
f - /usr/local - 2048
h - /usr/X11R6 - 1024
j - /var - 4096
p - /home - 19399
I tried installing fluxbox, linux base & gdm. I couldn't complete gdm build, '/usr' ran out of space. How do I shrink /home and increase /usr.

Best,

David
Reply With Quote
  #2   (View Single Post)  
Old 18th November 2010
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

4.8 release? there really isn't any reason to be building ports at all.. the requirements will well exceed the partition size.

That is a very strange layout, I'm not sure why you chose those sizes.

Use packages to fit within the alloted space, while I can't be entirely sure from that partial layout.. but a partition immediately proceeds /usr which would prevent growing it, perhaps you could recreate /usr if you reserved some space near the end of the partition.
Reply With Quote
  #3   (View Single Post)  
Old 18th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Lightbulb

Quote:
Originally Posted by BSDfan666 View Post
4.8 release? there really isn't any reason to be building ports at all.. the requirements will well exceed the partition size.

That is a very strange layout, I'm not sure why you chose those sizes.

Use packages to fit within the alloted space, while I can't be entirely sure from that partial layout.. but a partition immediately proceeds /usr which would prevent growing it, perhaps you could recreate /usr if you reserved some space near the end of the partition.

Yeah I'm on 4.8. I have shrunk /home by 3 gig, should I delete the /usr and create new or how do I go about it. 'r' shows handful of free space.

I had Linux installed first and openbsd labeled all the partitions, that is why the partition entries appear strange.

If I delete and re-create slices, will I be able to boot back.

Last edited by jewsofeast; 18th November 2010 at 04:01 AM.
Reply With Quote
  #4   (View Single Post)  
Old 18th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Lightbulb

I've removed distfiles and it freed some space.

Please let me know -
1. Is there anyway I can build in memory instead of writing to disk.
2. Can I copy /usr to /home and later recreate /usr slice.
3. I dont really need swap. Can I delete it.

Best,

David
Reply With Quote
  #5   (View Single Post)  
Old 18th November 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,710
Thanked 214 Times in 189 Posts
Default

Stop. Do not continue. Stop what you are doing. Cease "building." You are wasting your time. Your effort. Your energy.

Read the FAQ. In particular, read FAQ 15. To be specific, read FAQ 15.4.6. Now, go back and start at the beginning of FAQ 15. Now, READ IT AGAIN.

----

You cannot easily remove /usr or "move" it. You cannot do so while the system is running. It is possible to do so, but you have not, in your questions, shown that you have the *nix administration skills to do so. A complete reinstallation is advised. You will not have to "build" anything to do so.

I recommend that as a complete beginner, you start with ONE SINGLE BIG FILESYSTEM, "/". Don't bother setting up separate partitions until you have learned how to install, manage, and use the OS.

Keep swap space. The general recommendation is twice the size of your RAM, unless you have special requirements.
Reply With Quote
  #6   (View Single Post)  
Old 18th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Lightbulb

Quote:
Originally Posted by jggimi View Post
You cannot easily remove /usr or "move" it. You cannot do so while the system is running. It is possible to do so, but you have not, in your questions, shown that you have the *nix administration skills to do so. A complete reinstallation is advised. You will not have to "build" anything to do so.

I recommend that as a complete beginner, you start with ONE SINGLE BIG FILESYSTEM, "/". Don't bother setting up separate partitions until you have learned how to install, manage, and use the OS.

Keep swap space. The general recommendation is twice the size of your RAM, unless you have special requirements.
I did
Code:
cp -Rp /usr /home/usr
It copied stuff to '/home', nuked swap (I don't like it). Now there is space before 'd' or '/usr'. I tried nuking '/usr' and created 4G slice but wasn't able to mount it; had to undo that.

I guess I have fair *nix skills, got 30 OS (including OpenBSD) on my box, have built FreeBSD, NetBSD, Gentoo & Arch.

How do I link '/usr' to '/home/usr' for PKG_PATH. I on vacation and wont mind spending time on this.

Best,

David
Reply With Quote
  #7   (View Single Post)  
Old 18th November 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,710
Thanked 214 Times in 189 Posts
Default

Quote:
How do I link '/usr' to '/home/usr' for PKG_PATH.
If you insist on putting /usr under /home, $PKG_PATH is not going to be your biggest problem.

Important structures like /usr/bin, /usr/sbin, /usr/libexec, and /usr/lib are required just to to operate the OS. By the way, /usr/include is needed to "build" anything. And, since you mentioned GDM, you might find /usr/X11R6 of value, also, since that's needed for the X Windows System. There are many other structures under /usr that required for normal operation or maintenance. The hier(7) man page lists a number of them.

To move or resize /usr, you will need to operate the OS in single-user mode. And you will need to avoid executing any utilities from within /usr/bin or /usr/sbin or /usr/libexec during the operation.

You used cp(1) to create your replica, but that is not best practice for replicating filesystem, as it does not deal with hard links, device nodes, named pipes, or other special files. Far better tools would be dump(8) and restore(8), tar(1), cpio(1), or pax(1).

To "mount" /home/usr as /usr, you could create a local NFS mount, or create an iso image of /home/usr and mount it.. But:
This is not recommended, because you will have created an unsupportable, non-standard environment. A "Frankensystem". Unsupportable: no one will be able to answer questions about any problems that occur -- nor will anyone want to. And unsupported by the OpenBSD Project: no bug reports will be accepted or acted upon.
Quote:
nuked swap (I don't like it).
In the event all available memory is consumed by running processes or the kernel:
  1. applications will fail
  2. or the system will panic
  3. or the system will hang
The specific failure mode will depend on what particular service happened to request memory and fail to obtain it. Your likes or dislikes will not change this fact.
Reply With Quote
  #8   (View Single Post)  
Old 18th November 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,710
Thanked 214 Times in 189 Posts
Default

Step-by-step instructions for "resizing" /usr, using /home as a temporary storage facility. Warning: This is just typed up here for your convenience, just now. I have not -tested- this procedure as written, and may have made a mistake. Or two. Hint: If you blindly copy/paste these commands without understanding them, you are likely to get into trouble.
  1. Boot in single user mode. At the boot> prompt, enter "-s".
  2. Back up the existing /usr. It is assumed that /usr and /tmp and /home are defined in fstab(5):
    1. # mount /tmp
    2. # mount /home
    3. # dump -0af /home/usr.dump /usr
  3. Delete and recreate your /usr partition using disklabel(8) and newfs(8). This assumes you have the desired free space, and that the existing partition is on wd1d:
    1. # disklabel -E wd1
    2. d d
    3. a d
    4. [select your starting LBA]
    5. [select your size]
    6. [press ENTER to take the default FFS partition type]
    7. q
    8. # newfs wd1d
  4. Restore /usr from backup
    1. # mount -o async,noatime /dev/wd1d /usr
    2. # cd /usr
    3. # restore -rf /home/usr.dump
    4. # rm restoresymtable
  5. Reboot
    1. # reboot

Last edited by jggimi; 18th November 2010 at 02:30 PM. Reason: I had used gzip and gzcat when I wrote this. Sorry, but no, they're in /usr/bin and require /usr/lib.
Reply With Quote
  #9   (View Single Post)  
Old 18th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Lightbulb

Quote:
Originally Posted by jggimi View Post
Step-by-step instructions for "resizing" /usr, using /home as a temporary storage facility. Warning: This is just typed up here for your convenience, just now. I have not -tested- this procedure as written, and may have made a mistake. Or two. Hint: If you blindly copy/paste these commands without understanding them, you are likely to get into trouble.
  1. Boot in single user mode. At the boot> prompt, enter "-s".
  2. Back up the existing /usr. It is assumed that /usr and /tmp and /home are defined in fstab(5):
    1. # mount /tmp
    2. # mount /home
    3. # dump -0af /home/usr.dump /usr
  3. Delete and recreate your /usr partition using disklabel(8) and newfs(8). This assumes you have the desired free space, and that the existing partition is on wd1d:
    1. # disklabel -E wd1
    2. d d
    3. a d
    4. [select your starting LBA]
    5. [select your size]
    6. [press ENTER to take the default FFS partition type]
    7. q
    8. # newfs wd1d
  4. Restore /usr from backup
    1. # mount -o async,noatime /dev/wd1d /usr
    2. # cd /usr
    3. # restore -rf /home/usr.dump
    4. # rm restoresymtable
  5. Reboot
    1. # reboot
Thanks mate, I will give it a rip in arvo.

I know swap can save life but i am on i386 atm and that doesnt read my complete ram. I will resize '/home' and put the swap at the end of the disk.

Best,

David
Reply With Quote
Old 19th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Lightbulb

Been there done that -

Quote:
boot> -s
!bin/sh
mount /tmp
mount /usr
mount /home
dump -0af /home/usr.dump /usr
umount /usr
disklabel -E wd1
d d
a d (it offered free space and I opted for it)
q
nwfs wd1d
mount /usr
df-h
cd /usr
restore -rf /home/usr.dump
rm restoresymtable
df -h
Thanks, jggimi!

I'm having same issue with NetBSD 5.0.2, can I apply these there.

Best,

David
Reply With Quote
Old 19th November 2010
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,710
Thanked 214 Times in 189 Posts
Default

Not in this thread, no.
Reply With Quote
Old 19th November 2010
jewsofeast jewsofeast is offline
Port Guard
 
Join Date: Nov 2010
Posts: 26
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by jggimi View Post
Not in this thread, no.
Okay, I will make another thread under NetBSD section.
Reply With Quote
Reply

Tags
sub-slice resizing

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
Resizing /usr abdo88 FreeBSD General 15 12th July 2008 01:49 PM
Resizing FreeBSD partition Cloud FreeBSD General 3 28th June 2008 03:40 AM


All times are GMT. The time now is 02:58 PM.


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