Re: using /sbin/gpart to add GPT volume

2011-10-11 Thread Thomas Mueller
I don't think you can use gpart on a slice of an MBR-partitioned disk.

You can run man gpart if you didn't already; I didn't see anything to migrate 
an MBR partition table to GPT.

The older gpt, which NetBSD still uses, can migrate an MBR partition table to 
GPT.

You could try Roderick Smith's gdisk

http://www.rodsbooks.com/gdisk/

which is found, among other places, on the System Rescue CD

http://sysrescccd.org/

also in sysutils/gdisk in FreeBSD ports tree.

Rod Smith's gdisk can make a wider variety of partition types than gpt or gpart,
and can also migrate an MBR partition table to GPT.


Tom

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


using /sbin/gpart to add GPT volume

2011-10-10 Thread n dhert
I have a FreebSD 8.2 machine with 12 1-Tb disks used for making backups.
This is RAID6 with 2 volumes 200GB (system) and 8800 GB (for backup data)
When this machine was installed (jan 2009), I use standard BSD install to
put the system on the 200GB volume

Then I used  /sbin/gpt then to make the second volume available for freeBSD
(since volume 2 is 2Tbyte  gpt was needed)

The situation is now:
Filesystem  1024-blocks   Used  Avail Capacity  Mounted on
/dev/da0s1a 2026030 279538158441015%/
devfs 1  1  0   100%/dev
/dev/da0s1e20308398512   18683216 0%/tmp
/dev/da0s1f957272049599272   7846975611%/usr
/dev/da0s1d203083981517948   17165780 8%/var
/dev/da1p1   8323314852 6484140424 117330924085%/home

I see /sbin/gpt no longer exists, but has been replaced by /sbin/gpart

$ gpart show
=   63  390624696  da0  MBR  (186G)
 63  3906204121  freebsd  [active]  (186G)
  390620475   4284   - free -  (2.1M)

=0  390620412  da0s1  BSD  (186G)
  04194304  1  freebsd-ufs  (2.0G)
4194304  104857600  2  freebsd-swap  (50G)
  109051904   41943040  4  freebsd-ufs  (20G)
  150994944   41943040  5  freebsd-ufs  (20G)
  192937984  197682428  6  freebsd-ufs  (94G)

= 34  17187494333  da1  GPT  (8.0T)
   34  171874943331  freebsd-ufs  (8.0T)
shows my disks ..


I have free slots for extra disks, If I add disks and make a third RAID6
volume   (da2)
then with gpart I should be able to make a file system of that and mount it
e.g. under /home2 via something like:
# gpart create -s GPT da2
# gpart add -t efi da2(type efi is a tytpe where GPT partitioning scheme
is used (man gpart))
# gpart show
# newfs /dev/da2p1
# mkdir /home2
# mount /dev/da2p1 /home2
(and edit /etc/vfstab for mounting at boot)

I just wanted to try that out op a PC (is already a triple boot: OpenSUSE,
Windows and FreeBSD 8.2)
Using a CD GParted, I freed up some space so that I have an unallocated
space of 970 MB and rebooted the machine in FreeBSD
# sysinstall / Configure / FDisk shows me:
--
Disk name:  ad0FDISK Partition
Editor
DISK Geometry:  79780 cyls/16 heads/63 sectors = 80418240 sectors (39266MB)

Offset   Size(ST)End Name  PType   Desc  Subtype
Flags
 0 63 62- 12 unused0
63   22233897   22233959ad0s1  4 NTFS/HPFS/QNX7
  22233960   29639736   51873695ad0s3  8freebsd  165
  51873696189   51873884- 12 unused0
  51873885   26539380   78413264ad0s2  4 extended DOS, LBA   15
  784132651992060   80405324ad0s4  4 ext2fs  131
  80405325  12915   80418239- 12 unused0
--
 (ad0s1 is my Windows, ad0s3 my freebsd, ad0s2 is my OpenSUSE)
 ad0s4 is my free space

gpart so far shows  (nothing created yet in the unallocated space)
$ gpart show
=  63  80418177  ad0  MBR  (38G)
63  222338971  ntfs  (11G)
  22233960  296397363  freebsd  [active]  (14G)
  51873696   189   - free -  (95K)
  51873885  265393802  !15  (13G)
  78413265   19920604  !131  (973M)
  80405325 12915   - free -  (6.3M)
=   0  26539380  ad0s2  EBR  (13G)
 0   2072385  1  !130  (1.0G)
   2072385  18249840  32896  !131  (8.7G)
  2035   6152895  322576  !131  (2.9G)
  26475120 64260 - free -  (31M)
=   0  29639736  ad0s3  BSD  (14G)
 0   1048576  1  freebsd-ufs  (512M)
   1048576   1994384  2  freebsd-swap  (974M)
   3042960   3092480  4  freebsd-ufs  (1.5G)
   6135440   1048576  5  freebsd-ufs  (512M)
   7184016  22455720  6  freebsd-ufs  (11G)

now I try to create
# gpart create -s GPT ad0s4
gpart: provider: Device not configured

What's wrong?
Well, I see that in 2009 when I used /sbin/gpt, I did try that out also on a
PC, and then used   # gpt create -f /dev/ad0s4
where option -f then meant:  an existing MBR is destroyed and any partitions
described by the MBR are lost.

Must I do a # gpart destroy -F
before # gpart create ...
or what ?

I'm not at all familiar with gpart usage ...
and would like neither to screw up my  PC, nor screw up my backup-system ...
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: using /sbin/gpart to add GPT volume

2011-10-10 Thread ill...@gmail.com
On 10 October 2011 11:33, n dhert ndhert...@gmail.com wrote:
 I have a FreebSD 8.2 machine with 12 1-Tb disks used for making backups.
 now I try to create
 # gpart create -s GPT ad0s4
 gpart: provider: Device not configured

(NB I do not have a multi-boot system with an
MBR scheme on it, so I'm not clear on the pre-
cise details)
You want some variation of
# gpart add -t freebsd-ufs ad0[s4]

create is for the disk-wise scheme
add is for the individual slices/partitions

Again, I haven't played with gpart on an MBR disk,
so be careful.

Aso, if you're muddling with the boot disk, you may
have to work in single-user mode.

-- 
--
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: using /sbin/gpart to add GPT volume

2011-10-10 Thread n dhert
In jan 2009 when /sbin/gpt still existed, this is what I did on a multi-boot
test PC, after creatng unallocated spac, booting into my freebsd partition:

# sysinstall
Disk name:  ad0FDISK Partition
Editor
DISK Geometry:  5005 cyls/255 heads/63 sectors = 80405325 sectors (39260MB)
Offset   Size(ST)End Name  PType   Desc  Subtype
Flags
 0 63 62- 12 unused0
63   29414952   29415014ad0s1  4 NTFS/HPFS/QNX7
  294150153116610   32531624ad0s4  4 ext2fs  131
  32531625 62   32531686- 12 unused0
  32531687   14313853   46845539ad0s3  8freebsd  165
  46845540   33559785   80405324ad0s2  4 extended DOS, LBA   15
  80405325  12915   80418239- 12 unused0
ad0s4 was the unallocated space
# gpt create -f /dev/ad0s4
# gpt show /dev/ad0s4
start size  index  contents
01 PMBR
11 Pri GPT header
2   32 Pri GPT table
   34  3116543
  3116577   32 Sec GPT table
  31166091 Sec GPT header

# gpt add /dev/ad0s4
/dev/ad0s4p1 added
# gpt show /dev/ad0s4
start size  index  contents
01 PMBR
11 Pri GPT header
2   32 Pri GPT table
   34  3116543  1  GPT part - FreeBSD UFS/UFS2
  3116577   32 Sec GPT table
  31166091 Sec GPT header
# newfs /dev/ad0s4p1
# mkdir /ghome
# mount /dev/ad0s4p1 /ghome
# df -k
Filesystem   1024-blocksUsed   Avail Capacity  Mounted on
/dev/ad0s3a   380654  170430  17977249%/
devfs  1   1   0   100%/dev
/dev/ad0s3e   317166  56  291738 0%/tmp
/dev/ad0s3f  5144698 3167822 156530267%/usr
/dev/ad0s3d   571118   28080  497350 5%/var
/dev/ad0s4p1 1504908   4 1384512 0%/ghome
My problem is, what are the equivalent instructions using  gpart ???




2011/10/10 ill...@gmail.com ill...@gmail.com

 On 10 October 2011 11:33, n dhert ndhert...@gmail.com wrote:
  I have a FreebSD 8.2 machine with 12 1-Tb disks used for making backups.
  now I try to create
  # gpart create -s GPT ad0s4
  gpart: provider: Device not configured

 (NB I do not have a multi-boot system with an
 MBR scheme on it, so I'm not clear on the pre-
 cise details)
 You want some variation of
 # gpart add -t freebsd-ufs ad0[s4]

 create is for the disk-wise scheme
 add is for the individual slices/partitions

 Again, I haven't played with gpart on an MBR disk,
 so be careful.

 Aso, if you're muddling with the boot disk, you may
 have to work in single-user mode.

 --
 --

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org