DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

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

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th August 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Default Adding a separate /home

Hello,

I just built a new computer and it has two hard drives in it. I was originally going to put them into RAID1, but since the onboard controller turned out to basically be a software controller and not a true hardware one, it was too much of a headache to configure right now. What I now want to do is use the second disk (partially) as a /home that I can maintain during upgrades, etc. I have one setup like this for Slackware already, but I'm trying to get this accomplished in NetBSD. Here is the setup:

disk 1:

sda1 - Slackware
sda2 - Linux swap
sda3 - NetBSD
sda4 - (probably) NetBSD-testing

disk 2:

sdb1 - Slackware /home
sdb2 - NetBSD /home


It is the sdb2 that I need to get configured. I need to format it (I assume that will be done using fdisk), and then configure NetBSD on sda3 to mount it as /home (edit fstab?).

I have an idea of how to accomplish this, but not entirely (especially the fine details - still learning BSD).

What I figure is format it with fdisk (not certain of the correct format and sequence of the switches) and then edit fstab to have it mount.

/dev/wd1b /home ffs rw 1 2

Is that the correct fstab entry?
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
Reply With Quote
  #2   (View Single Post)  
Old 28th August 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,318
Default

Quote:
Originally Posted by JMJ_coder View Post
I need to format it (I assume that will be done using fdisk), and then configure NetBSD on sda3 to mount it as /home (edit fstab?).
fdisk(8) is only used to create MBR partitions. If the second disk was only going to be used for NetBSD, use of fdisk(8) would not be required at all. MBR partitions are only required because two separate filesystems will reside on the same disk.

Most likely, the second disk will be /dev/wd1 which can be confirmed in the output of dmesg(8). By the time you see dmesg(8) output, you will have already resolved the problem of ensuring that the BIOS is booting the correct drive. If you end up fighting this battle, there will either be a BIOS setting that controls which drive is used for booting, or else you will have to determine which IDE channel is for the boot device by swapping cables.

Once the second drive is partitioned in the MBR sense, you will need to create any NetBSD slice needed (outside of slice d which is defined by default...) through disklabel(8). Once all NetBSD slices needed have been defined, each NetBSD filesystem will need to be initialize via newfs(8) (excluding slice d or b if defined...). Note that slices will not be able to be mounted until newfs(8) has been used to initialize them. You will need to boot NetBSD with the second drive attached & initialize each slice before mounting either manually or entering into fstab(5).

Note that the installation program performs the very same steps:
  • Identify what disks will be used by NetBSD.
  • Run fdisk(8) as needed.
  • Run disklabel(8) to define slices.
  • Run newfs(8) on each slice (excluding b or d...) to initialize each filesystem.
  • Construct /etc/fstab.
Quote:
What I figure is format it with fdisk (not certain of the correct format and sequence of the switches) and then edit fstab to have it mount.

/dev/wd1b /home ffs rw 1 2

Is that the correct fstab entry?
As you become more familiar with NetBSD, you will memorize the following topology:

http://www.netbsd.org/docs/guide/en/...tall-partition

...which diagrammatically describes how NetBSD slices relate to the overall disk. Slice b is always used for swap if any swap space is allocated, & slice d always represents the entire disk. Any other slice can be used for any other use, however by convention, a is considered to contain a bootable kernel.

Yes, it is unfortunate that the term "partition" in the Intel world contradicts what is meant in the *BSD world, but that is the way it is. The *BSD concept transcends platforms, so the terminology comes from a different focus.

Last edited by ocicat; 28th August 2008 at 09:14 PM.
Reply With Quote
  #3   (View Single Post)  
Old 29th August 2008
JMJ_coder JMJ_coder is offline
VPN Cryptographer
 
Join Date: May 2008
Posts: 464
Default

Thanks.
__________________
And the WORD was made flesh, and dwelt among us. (John 1:14)
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
What are rules about adding commands to mfsroot? PeterSteele FreeBSD Installation and Upgrading 12 18th November 2008 04:21 PM
Adding drives annoys OpenBSD. diw OpenBSD General 4 4th September 2008 02:14 AM
Adding Additional Video Card JMJ_coder General software and network 0 19th July 2008 07:16 PM
Having trouble adding 7.0 to GRUB 0.97 Arenlor FreeBSD General 4 26th June 2008 01:02 AM
/etc on a separate partition DarkEnergy FreeBSD Installation and Upgrading 13 20th May 2008 04:24 AM


All times are GMT. The time now is 09:37 AM.


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