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 20th May 2014
Tzzzzzzzz Tzzzzzzzz is offline
New User
 
Join Date: May 2014
Posts: 4
Thanked 0 Times in 0 Posts
Default resize root partition of my server

Hi,

my root size has a strange partition layout at delivery.

The 1GB HDD has 1 partition with 2 slice.

Code:
#                size           offset  fstype [fsize bsize  cpg]
  a:         10485760               63  4.2BSD   2048 16384    1 # /
  b:          2097585         10485823    swap                   # none
  c:       1953525168                0  unused
I'm trying to resize the root partition. But I do not find a good idea how to do it (reading all different how to and man pages). Perhaps I'm just too blind to see where to start. (I do not want to bore you with all the things I tried...)

Can please someone give me a hint or how to?

Thx for your help, Tzzzzzzzz
Reply With Quote
  #2   (View Single Post)  
Old 20th May 2014
ibara's Avatar
ibara ibara is offline
Shell Scout
 
Join Date: Jan 2014
Posts: 129
Thanked 0 Times in 0 Posts
Default

growfs(8) is usually used for this sort of thing. But it only works on unmounted partitions.

But I'm more inclined to suggest that if this really is the root you just reinstall the OS and do the right thing from the get-go (what arch is this that you only have a 1 GB HDD?).
__________________
@bcallah on app.net
NYC*BUG
Reply With Quote
  #3   (View Single Post)  
Old 21st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Hello, and welcome!

If the sector size is 512-byte, then this is a 1TB drive, not 1GB, and the root partition is 5GB

The growfs tool can be used, but .. only after deleting the swap partition. However, ibara has excellent guidance. I agree with him for two reasons: 1) repartitioning while using only the RAMDISK kernel may require skills you do not yet have as a new user, and 2) on MBR-based architectures, the second stage bootloader must be physically located within a BIOS-specific limit, and enlarging your root partition beyond that limit -- if you are using an MBR-based architecture, which is likely - risks making your system unbootable.

Last edited by jggimi; 21st May 2014 at 12:35 AM. Reason: typos, as I never read carefully before posting. :(
Reply With Quote
  #4   (View Single Post)  
Old 21st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Posting again to add some additional background for my comment regarding the various BIOS boot sector location limits. This is an excerpt from OpenBSD FAQ 4.8: How should I partition my disk?
Code:
  * Size: Many machines have limits on the area of a disk where the boot ROM
    can load the kernel from. In some cases, this limit may be very small
    (504M for an older 486), in other cases, a much larger limit (for example,
    2G, 8G, or 128G on i386 systems). As the kernel can end up anywhere within
    the root partition, the entire root partition should be within this area.
    For more details, see this section. A good guideline might be to keep your
    / partition completely below 2G, unless you know your platform (and
    particular machine) can handle more (or less) than that.
Reply With Quote
  #5   (View Single Post)  
Old 21st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Correction:

Boot sector limits can affect other architectures, not just those with MBRs (amd64, armish, armv7, i386, macppc, zaurus). Both the bootloader and the kernel must reside within the BIOS sector addressing limit, as the kernel is read by the bootloader using BIOS I/O services.
Reply With Quote
  #6   (View Single Post)  
Old 21st May 2014
Tzzzzzzzz Tzzzzzzzz is offline
New User
 
Join Date: May 2014
Posts: 4
Thanked 0 Times in 0 Posts
Default

Sorry, my mistake: of course the size is 1000GB (about 1TB).

Ok the recommendation is to set up the OS new and to resize the partitions while reinstalling. But where to start now. It is root server and i have just vKVM and
Rescue Mode (Linux/FreeBSD) to choose from.

Can you give me please a starting point.

Thx, Tzzzzzzzz
Reply With Quote
  #7   (View Single Post)  
Old 21st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Quote:
But where to start now. It is root server and i have just vKVM and
Rescue Mode (Linux/FreeBSD) to choose from.

Can you give me please a starting point.
Ah. It must not be your hardware. It is only a guess, based on what you've posted here, that your platform is a server in the cloud and that your service provider installed OpenBSD for you. If so, you will need to ask them how they provisioned it, and why they made the choices they did. We can't tell you what they did, other than by what you post here.

Based on what little we know -- that there is a mostly empty disk drive available to you -- you should be able to add additional partitions. The "a" partition is your root partition, "b" is your swap partition, and "c" is reserved as the full drive. You can add 13 more partitions, up to "p".

The disklabel(8) program is used to add more partitions -- and they can be set to mount automatically in fstab(5).

For example, let us pretend that you need a 100GB /var for a database. You could create a new 100GB partition with some new disklabel letter, such as "d", format it with newfs(8), mount(8) it temporarily, use mv(1) or tar(1) or pax(1) or dump(8) / restore(8) to migrate all of /var into the new partition, then use $EDITOR to add the new partiion to /etc/fstab as mount point /var, and reboot.

How you proceed is up to you, whether you create new mount points or move data around. All of FAQ 14 will be helpful, and FAQ 14.4 in particular can be used as a guide, with the understanding that it covers adding partiitons on new drives, and you would be adding partitions to the existing drive.

My apologies for any confusion. My initial assumption here, due to lack of other information, was that you had control of your hardware. My understanding now is that you do not.

Last edited by jggimi; 21st May 2014 at 10:18 PM. Reason: clarity, typos. As usual.
Reply With Quote
  #8   (View Single Post)  
Old 21st May 2014
Tzzzzzzzz Tzzzzzzzz is offline
New User
 
Join Date: May 2014
Posts: 4
Thanked 0 Times in 0 Posts
Unhappy

Ok. That was exactly question. I thought that the best way would be to resize the root slice )to the biggest possible size. But perhaps it is better to use different mounting points.

What do you think about this?

Code:
  a:         5GB              /
  b:         1GB              SWAP
  c:         1000GB         unused
  d:         20GB            /usr
  e:         10GB            /tmp
  f:          10GB            /var
  h:         850GB          /home
Thx, Tzzzzzzz
Reply With Quote
  #9   (View Single Post)  
Old 21st May 2014
ibara's Avatar
ibara ibara is offline
Shell Scout
 
Join Date: Jan 2014
Posts: 129
Thanked 0 Times in 0 Posts
Default

This looks like something the autoformatter would do. Of course, you haven't told us what your use-case for the machine looks like. That would get you better answers.
__________________
@bcallah on app.net
NYC*BUG
Reply With Quote
Old 21st May 2014
Tzzzzzzzz Tzzzzzzzz is offline
New User
 
Join Date: May 2014
Posts: 4
Thanked 0 Times in 0 Posts
Default

Just small mail server (with mySQL-database for postfix) and private ftp server (backup). Normally i use encrypt to create a virtual drive and mount it into the ftp server directory.
Reply With Quote
Old 21st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

First:

I don't have any opinion about the sizes you've selected, since storage needs are entirely dependent upon the use of the system. For example, that 850GB /home partition may sit nearly empty and unused. Or, the 850GB may not be enough. It depends what you plan to use the partition for. Or any of the partitions. Keep in mind: you do not need to pre-allocate space if you do not yet know what your needs are.
  • Re-allocating system partitions must be done in single-user mode, since you can't "move" data in use by running services, and you certainly would not want to force umount(8) a filesystem with files open for writing.
  • Re-allocating a root partition requires booting the RAMDISK kernel, as discussed above.
Second:

Your service provider has given you a 5GB system in a single partition., apparently pre-configured. That may or may not be enough space for your intended "system" even if application data is stored in other, new partitions. Talk to them.
  • They provide your server to you.
  • You pay them.
  • They know what they did.
  • They know why they did what they did.
  • They may have recommendations, which should supersede any advice you get from a bunch of OS users on the Internet.
All very good reasons to speak with them first.

Third:

I recommend you install this OS on a hardware platform you control yourself. One that you can touch and feel. Where you can practice, safely make administrative mistakes, and learn.

A remote platform out of your operational control is not conducive to learning.

Last edited by jggimi; 21st May 2014 at 10:53 PM. Reason: clarity. again. (sigh.)
Reply With Quote
Old 21st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by Tzzzzzzzz View Post
...private ftp server (backup). Normally i use encrypt to create a virtual drive and mount it into the ftp server directory.
FTP is an insecure protocol. All information, including passwords, are sent in the clear. There is no encryption of the data moved via network. Alternative services that provide for encryption of data in motion, have well understood key management techniques and robust authentication schema should be considered instead. Such as sftp(1), or ssh(1).

For data at rest, OpenBSD has two encryption technologies for filesystems. There is the CRYPTO discipline of softraid(4), which is recommended for general use, and the older encryption capability of vnconfig(8), which may be useful in some circumstances.

Last edited by jggimi; 21st May 2014 at 11:08 PM. Reason: clarity again. And two typos.
Reply With Quote
Old 21st May 2014
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,906
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by Tzzzzzzzz View Post
What do you think about this?

Code:
  a:         5GB              /
  b:         1GB              SWAP
  c:         1000GB         unused
  d:         20GB            /usr
  e:         10GB            /tmp
  f:          10GB            /var
  h:         850GB          /home
The general heuristic (& you don't have to follow it...) for determining how much swap space to configure is 2x the amount of RAM. Likewise, /var/crash can be used to capture crash dumps, but sufficent space will need to be available for (roughly) 2x the amount of RAM here too. You should familiarize yourself with the savecore(8) & crash(8) manpages for more information on these features.

dmesg(8) output can also help you determine the amount of addressable RAM.
Reply With Quote
Old 31st May 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Quote:
Originally Posted by jggimi View Post
...and the older encryption capability of vnconfig(8)....
Yesterday, vnconfig encryption was determined to be insecure, and the encryption feature will be removed next year (5.7). The Softraid CRYPTO discipline is the recommended alternative.
Reply With Quote
Old 2nd June 2014
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,823
Thanked 214 Times in 189 Posts
Default

Ted Unangst (tedu@) has additional information regarding his patch to vnconfig/mount_vnd:
Quote:
You would never use blowfish-cbc (with a 64-bit blocksize) for disk encryption today. You can probably find a wiki page somewhere with details, but the reality is most people aren't capable of assessing whether this is "secure enough".

Part of the deprecation / migration process is identifying the weird ways people use vnd and finding solutions for them. But as we've seen, people never move forward without the occasional push.

Last edited by jggimi; 2nd June 2014 at 08:57 PM. Reason: typo
Reply With Quote
Old 2nd June 2014
frcc frcc is offline
Don't Worry Be Happy!
 
Join Date: Jul 2011
Location: hot,dry,dusty,rainy,windy,straight winds, etc-Texas
Posts: 54
Thanked 0 Times in 0 Posts
Default Partitions

Quote:
Originally Posted by jggimi View Post
First:

I don't have any opinion about the sizes you've selected, since storage needs are entirely dependent upon the use of the system. For example, that 850GB /home partition may sit nearly empty and unused. Or, the 850GB may not be enough. It depends what you plan to use the partition for. Or any of the partitions. Keep in mind: you do not need to pre-allocate space if you do not yet know what your needs are.
  • Re-allocating system partitions must be done in single-user mode, since you can't "move" data in use by running services, and you certainly would not want to force umount(8) a filesystem with files open for writing.
  • Re-allocating a root partition requires booting the RAMDISK kernel, as discussed above.
Second:

Your service provider has given you a 5GB system in a single partition., apparently pre-configured. That may or may not be enough space for your intended "system" even if application data is stored in other, new partitions. Talk to them.
  • They provide your server to you.
  • You pay them.
  • They know what they did.
  • They know why they did what they did.
  • They may have recommendations, which should supersede any advice you get from a bunch of OS users on the Internet.
All very good reasons to speak with them first.

Third:

I recommend you install this OS on a hardware platform you control yourself. One that you can touch and feel. Where you can practice, safely make administrative mistakes, and learn.

A remote platform out of your operational control is not conducive to learning.

jggimi's Third quote is especially useful for newbies.

Used industrial hardware is cheap.
In my area you can pick up an IBM or HP
server for under $100. These servers offer speeds
of 1 to 3 ghz, hot swap scsi hd's, dual pwr supplies, multiple
nic cards, reasonable monitor resolition, ps2 or usb mice and
keyboards, rack mounted, hardware raid, expandable memory, etc.
They are designed for web hosting, data transfer, sftp, ssh, from
the gitgo, and their performance is designed for continuous industrial use.

The majority of these servers are
very compatible with the BSD and Linux world.
(most are just not leading edge enough for those who care)

I currently run several IBM series 330e's (relatively quiet and eff),
for web service and data storage. Oscasionally I run up to 4 HPDL
series 360 and 380's, but they like the amps and produce alot of
noise.

As a newbie I can't imagine the amount of time I would
have spent if I had to deal with hd being physically
located/hosted elsewhere.

Having hands on capability encourages experimentation!
The results, although not without pain sometimes, do lend
themselves to being characterized as learning. Simply re-install the OS,
and try something different..........
"You do back up your data, right?"

Security,,,,,,having physical access control will indeed enhance it.
Too many references to list here.....

Although it may be a necessary step now, communicating
with a hosting co, takes away time and resourses that could
be applied to becomming more proficient with OpenBSD

Last edited by frcc; 2nd June 2014 at 11:29 PM.
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
FreeBSD won't boot after mounting root partition on OpenBSD Jtf FreeBSD Installation and Upgrading 12 19th March 2014 04:43 AM
add another partition? amandus FreeBSD General 2 11th June 2013 02:51 PM
China censorship leaks outside Great Firewall via DNS root server J65nko News 0 25th March 2010 08:23 PM
tmux disable automatic resize Carpetsmoker General software and network 7 25th June 2009 10:54 PM
Sun Java System Web Server - Active Server Pages (yes ASP) hopla FreeBSD General 0 26th September 2008 08:22 AM


All times are GMT. The time now is 02:21 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