DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD Installation and Upgrading

FreeBSD Installation and Upgrading Installing and upgrading FreeBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 18th March 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 270
Thanked 23 Times in 23 Posts
Default Creating 2 slices

Hello,

I'm thinking of creating two FreeBSD slices (BIOS partitions) on the same disk: one for /, /tmp, /var, /usr and the second for /home.

1. Is this possible?

2. If I ever reinstall the system or install a new version, will sysinstall keep all files under /home intact (I believe there's a flag for that in disklabel)?

Thank you.
__________________
May the source be with you!
Reply With Quote
  #2   (View Single Post)  
Old 18th March 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,147
Thanked 182 Times in 149 Posts
Default

Re: 1.
Yes that is possible

Re: 2
Sysinstall will only touch those slices, you tell it to touch.

Remember that each FreeBSD slice has it's own disklabel. Your "/etc/fstab", which contain the instructions for 'mount" will thus look something like this:
Code:
/dev/ad0s1a /     bla,bla,bla
/dev/ad0s2d /home bla,bla,bla
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 18th March 2009
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Old man from scene 24
 
Join Date: Apr 2008
Location: Eindhoven, Netherlands
Posts: 2,068
Thanked 198 Times in 156 Posts
Default

Quote:
Originally Posted by J65nko View Post
Remember that each FreeBSD slice has it's own disklabel. Your "/etc/fstab", which contain the instructions for 'mount" will thus look something like this:
Code:
/dev/ad0s1a /     bla,bla,bla
/dev/ad0s2d /home bla,bla,bla
You don't exactly need to put a disklabel on /dev/ad0s2, just newfs ad0s2 and it will mount&work fine.
It is often a good practice for the sake of consistency though...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #4   (View Single Post)  
Old 20th March 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 270
Thanked 23 Times in 23 Posts
Default

Ok, I created a third slice using "fdisk -u ad0" and following the instructions. It created /dev/ad0s3, /dev/ad0s3a and /dev/ad0s3c.
Isn't "a" usually used for "/"?
Anyway, /dev/ad0s3a seems to occupy most of the space available on the slice. So I did newfs on /dev/ad0s3a and it seems to work fine.
How would I create ad0s3d? I tried "bsdlabel -e ad0s3", copied the already existing "a" line and just changed the letter "a" to "d", but when I do a "wq", it doesn't write anything. I did "bsdlabel -e ad0s3" again and all changes were gone.
__________________
May the source be with you!
Reply With Quote
  #5   (View Single Post)  
Old 21st March 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,147
Thanked 182 Times in 149 Posts
Default

Fdisk is only used to create slices (MBR partitions). It will not create labels.

You have to use bsd/disklabel to divide a slice in different sub-partitions. Each of these sub-partitions are defined by a starting sector (offset in bsdlabel) and a size. So just copying the offset and size and changing the label will never work. That would create two identical sub-partitions, which is not allowed.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #6   (View Single Post)  
Old 21st March 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 270
Thanked 23 Times in 23 Posts
Default

Quote:
Fdisk is only used to create slices (MBR partitions). It will not create labels.
Yes indeed, it only creates /dev/ad0s3. These labels were leftovers from my prior mess-ups, so I got confused.



By default, if I do a
bsdlabel -w /dev/ad0s3
then
bsdlabel -e /dev/ad0s3
I see partitions "a" and "c" in vi.

In my last post I was asking about this "a" partition. Isn't it always used for the system's root filesystem "/"?
From your first reply, you suggested I create a "d" partition:
Code:
/dev/ad0s1a /     bla,bla,bla
/dev/ad0s2d /home bla,bla,bla
Should I NOT use the default "a" and change it instead to "d"?



That's what I'm doing. Is it the proper way to do it?
1. fdisk -u ad0 ; follow the steps and add a third slice
2. bsdlabel -w /dev/ad0s3 ; this creates /dev/ad0s3a and /dev/ad0s3c
3. bsdlabel -e /dev/ad0s3 ; change "a" to "d" and save
4. now there's /dev/ad0s3c and /dev/ad0s3d
5. newfs -U /dev/ad0s3d
6. mount /dev/ad0s3d /mnt/new
__________________
May the source be with you!
Reply With Quote
  #7   (View Single Post)  
Old 22nd March 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,147
Thanked 182 Times in 149 Posts
Default

Yes, label "a" is used for the "/" root partition. However if you use multiple slices, you can use it for another partition, if you like. Personally, I try to prevent using "a" for a non-root partition. It is just my preference

Quote:
1. fdisk -u ad0 ; follow the steps and add a third slice
2. bsdlabel -w /dev/ad0s3 ; this creates /dev/ad0s3a and /dev/ad0s3c
3. bsdlabel -e /dev/ad0s3 ; change "a" to "d" and save
4. now there's /dev/ad0s3c and /dev/ad0s3d
5. newfs -U /dev/ad0s3d
Yes, that is correct
Now do:
Code:
6) mkdir /home
7) edit /etc/fstab to add : /dev/ad0s3d /home,
   followed by the filesystem stuff and mount options
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #8   (View Single Post)  
Old 23rd March 2009
Beastie Beastie is offline
Daemonology student
 
Join Date: Jan 2009
Location: /dev/earth0
Posts: 270
Thanked 23 Times in 23 Posts
Default

Thanks very much.
__________________
May the source be with you!
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
Creating port backrow OpenBSD Packages and Ports 9 9th September 2009 11:55 AM
Command to find and replace, but not creating a new file 18Googol2 Programming 4 22nd September 2008 10:28 PM
Creating a flash player jgroch Programming 0 21st August 2008 05:27 AM
how to mount Open solaris UFS slices whispersGhost FreeBSD General 12 20th May 2008 02:56 PM


All times are GMT. The time now is 06:01 AM.


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