Re: FreeBSD fdisk how to?
On Sat, Jun 21, 2008 at 11:26:01AM +0200, Nejc Škoberne wrote: > Hi, > > > Well, fdisk(8) is somewhat cumbersome to use. Personally I tend to invoke > > sysinstall(8) to create new slices (can be done after install too.) Much > > easier to use. > > OT, but: does sysinstall's "fdisk" also support gmirror and gstripe devices? No > Or do I need to use fdisk to make slices there? Yes. But it is not hard. First of all: _make backups_ ! To create this mirror configuration, the machine is booted from a CD which contains a live filesystem. I used the 7.0-RELEASE-amd64-livefs.iso image to create this CD. After the machine boots, the sysinstall(8) application is started automatically. In the first two menus you have to set your location and keyboard type. The location doesn't really matter since we won't be installing anything. It is probably best to choose the default keyboard layout, unless you know otherwise. Next the ``Fixit'' option is chosen, followed by the ``CDROM/DVD'' option in the next menu. We are now in the shell of the livefs. The first order of business is to check if the disks have been recognized. The command # ls /dev/ad* should return two disks. Now it is time to create a mirrored device using the gmirror(8) tool. Next the mirror is activated by loading the geom_mirror kernel module. After the kernel module has been loaded, the mirrored device \texttt/dev/mirror/gm0 should appear. # gmirror label gm0 ad4 ad6 # kldload /mnt2/boot/kernel/geom_mirror.ko Now it is time to devide the disks into slices (which are called partitions in PC parlance). The -I option creates one FreeBSD slice covering the entire disk. The -B option writes a boot block. # fdisk -vBI /dev/ad4 # fdisk -vBI /dev/ad6 Now that the disk has been given a single slice, a new device /dev/mirror/gm0s1 will appear. We will now subdivide that into FreeBSD partitions using bsdlabel(8). First we will write a standard label and boot blocks. # bsdlabel -wB /dev/mirror/gm0s1 # export EDITOR=/mnt2/usr/bin/ee # bsdlabel -e /dev/mirror/gm0s1 The command in the middle sets the editor to something more user friendly then vi! The last command will open a text editor with the partition table that the first command made. It should be edited to look like the following (for example); # /dev/mirror/gm0s1: 8 partitions: # size offset fstype [fsize bsize] a: 500M 16 4.2BSD 2048 16384 # / b: 8G* swap# Reserved for swap. c: * * unused 00 # "raw" part. d: 2G* 4.2BSD 2048 16384 # /var e: 50G * 4.2BSD 2048 16384 # /tmp f: 20G * 4.2BSD 2048 16384 # /usr g: * * 4.2BSD 2048 16384 # /home The disk partitions are now ready to put the filesystems on them. To minimize the chance of problems with the root partition, softupdates are not enabled for root. # newfs /dev/mirror/gm0s1a # newfs -U /dev/mirror/gm0s1d # newfs -U /dev/mirror/gm0s1e # newfs -U /dev/mirror/gm0s1f # newfs -U /dev/mirror/gm0s1g Now you can restore your backups. Before you reboot, edit /etc/fstab to mount the right partitions. And edit /boot/loader.conf to load the geom_mirror module. # echo 'geom_mirror_load="YES"' >>/boot/loader.conf Roland -- R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) pgpTdcK5Wkl9s.pgp Description: PGP signature
Re: FreeBSD fdisk how to?
Hi, Well, fdisk(8) is somewhat cumbersome to use. Personally I tend to invoke sysinstall(8) to create new slices (can be done after install too.) Much easier to use. OT, but: does sysinstall's "fdisk" also support gmirror and gstripe devices? Or do I need to use fdisk to make slices there? Thanks, Nejc ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
On Fri, Jun 20, 2008 at 01:48:44AM -0700, Unga wrote: > --- On Fri, 6/20/08, Wojciech Puchar <[EMAIL PROTECTED]> wrote: > > > From: Wojciech Puchar <[EMAIL PROTECTED]> > > Subject: Re: FreeBSD fdisk how to? > > To: "Unga" <[EMAIL PROTECTED]> > > Cc: freebsd-questions@freebsd.org > > Date: Friday, June 20, 2008, 3:57 PM > > > g c30401 h255 s63 > > > p 1 165 63 488392002 > > > a 1 > > > > > > > > > I ran fdisk as follows: > > > fdisk -f configfile -itv /dev/ad2 > > > > > > > is this disk FreeBSD only? don't use fdisk at all > > Yep this hard disk is for FreeBSD only. Why I should not use fdisk? What > should I use to partition a disk? I'm running FreeBSD 7.0. He is making what was popularly called a 'dangerously dedicated' disk. There are no slices, just partitions carved out of the raw disk. It is readable only by FreeBSD. It works, but I prefer to have the flexibility of using fdisk and creating slices and then dividing them in to partitions. jerry > > Regards > Unga > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
On Fri, Jun 20, 2008 at 03:44:59AM -0700, Unga wrote: > --- On Fri, 6/20/08, Wojciech Puchar <[EMAIL PROTECTED]> wrote: > > > From: Wojciech Puchar <[EMAIL PROTECTED]> > > Subject: Re: FreeBSD fdisk how to? > > To: "Unga" <[EMAIL PROTECTED]> > > Cc: freebsd-questions@freebsd.org > > Date: Friday, June 20, 2008, 6:32 PM > > >> > > >> newfs,mount,copy files,umount > > >> > > >> bsdlabel -B disk > > > > > > But this does not create slices, does it? > > > > yes. because slices are not needed if you want freebsd-only > > disk - that's > > why i asked for. > > IC, sorry may be I did not make myself clear enough then. The fdisk statement > I ran only with one partition entry is to learn fdisk, that's why I ran in > test mode. > > I need at least 2 partitions, one for FreeBSD 7 and other for FreeBSD 8. I > need two slices for that. > > I still need to understand clearly how to create slices in FreeBSD. I know 4 > slices per disk can be created. > > The question is, is what I posted on my first post sufficient to create > slices correctly? > > Btw, thank you very much for so many replies without giving up :) > Well, fdisk(8) is somewhat cumbersome to use. Personally I tend to invoke sysinstall(8) to create new slices (can be done after install too.) Much easier to use. Also, you can almost always ignore any warnings about the geometry of the disk. Once the kernel has booted FreeBSD does not make use of the geometry anyway, so it is only if you need to boot from the disk or if you use the disk from some other OS that it might matter (but it usually works just fine without any adjustments.) -- Erik Trulsson [EMAIL PROTECTED] ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
--- On Fri, 6/20/08, Wojciech Puchar <[EMAIL PROTECTED]> wrote: > From: Wojciech Puchar <[EMAIL PROTECTED]> > Subject: Re: FreeBSD fdisk how to? > To: "Unga" <[EMAIL PROTECTED]> > Cc: freebsd-questions@freebsd.org > Date: Friday, June 20, 2008, 6:32 PM > >> > >> newfs,mount,copy files,umount > >> > >> bsdlabel -B disk > > > > But this does not create slices, does it? > > yes. because slices are not needed if you want freebsd-only > disk - that's > why i asked for. IC, sorry may be I did not make myself clear enough then. The fdisk statement I ran only with one partition entry is to learn fdisk, that's why I ran in test mode. I need at least 2 partitions, one for FreeBSD 7 and other for FreeBSD 8. I need two slices for that. I still need to understand clearly how to create slices in FreeBSD. I know 4 slices per disk can be created. The question is, is what I posted on my first post sufficient to create slices correctly? Btw, thank you very much for so many replies without giving up :) Unga ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
newfs,mount,copy files,umount bsdlabel -B disk But this does not create slices, does it? yes. because slices are not needed if you want freebsd-only disk - that's why i asked for. ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
--- On Fri, 6/20/08, Wojciech Puchar <[EMAIL PROTECTED]> wrote: > From: Wojciech Puchar <[EMAIL PROTECTED]> > Subject: Re: FreeBSD fdisk how to? > To: "Unga" <[EMAIL PROTECTED]> > Cc: freebsd-questions@freebsd.org > Date: Friday, June 20, 2008, 5:18 PM > > > > Yep this hard disk is for FreeBSD only. Why I should > not use fdisk? > > because it's not needed. > > > > > clean it up > dd if=/dev/zero of=/dev/disk bs=64k count=1 > > make initial label > > bsdlabel -w disk > > edit label to your needs > > bsdlabel -e disk > > newfs,mount,copy files,umount > > bsdlabel -B disk But this does not create slices, does it? How to create multiple slices? Regards Unga ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
Yep this hard disk is for FreeBSD only. Why I should not use fdisk? because it's not needed. clean it up dd if=/dev/zero of=/dev/disk bs=64k count=1 make initial label bsdlabel -w disk edit label to your needs bsdlabel -e disk newfs,mount,copy files,umount bsdlabel -B disk ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
--- On Fri, 6/20/08, Wojciech Puchar <[EMAIL PROTECTED]> wrote: > From: Wojciech Puchar <[EMAIL PROTECTED]> > Subject: Re: FreeBSD fdisk how to? > To: "Unga" <[EMAIL PROTECTED]> > Cc: freebsd-questions@freebsd.org > Date: Friday, June 20, 2008, 3:57 PM > > g c30401 h255 s63 > > p 1 165 63 488392002 > > a 1 > > > > > > I ran fdisk as follows: > > fdisk -f configfile -itv /dev/ad2 > > > > is this disk FreeBSD only? don't use fdisk at all Yep this hard disk is for FreeBSD only. Why I should not use fdisk? What should I use to partition a disk? I'm running FreeBSD 7.0. Regards Unga ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: FreeBSD fdisk how to?
g c30401 h255 s63 p 1 165 63 488392002 a 1 I ran fdisk as follows: fdisk -f configfile -itv /dev/ad2 is this disk FreeBSD only? don't use fdisk at all ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"