Subject: Re: Large disks and NetBSD 4.0?
To: John Nemeth <jnemeth@victoria.tc.ca>
From: Ronald Roskens <ronr@econet.com>
List: netbsd-users
Date: 11/05/2007 11:31:08
On Thu, 2007-11-01 at 02:35 -0700, John Nemeth wrote:
> On Mar 18, 2:20pm, John Nemeth wrote:
> } On Mar 18, 12:40pm, Ronald Roskens wrote:
> } } On Fri, 2007-10-26 at 14:14 +0300, Jukka Marin wrote:
> } } >
> } } > I will try setting up a new server with a 3 TB (or so) RAID disk to be used
> } } > for XEN virtual machines. What is the best way of partitioning the disk -
> } } > is it possible to disklabel disks this big in the normal way or should I be
> } } > using wedges or something? Do wedges work with XEN?
> } }
> } } While I'm still new to setting up Xen under netbsd, here's some things
> } } I've learned:
> } }
> } } 2- The standard XEN3_DOM{0,U} kernels do not include the options for
> } } DKWEDGE_* and drvctl.
> } }
> } } wedges seem to be pretty cutting edge, and theres not a lot of
> } } documentation written about them. In particular, the ptype argument for
> } } dkctl addwedge isnt well defined. The types arent the same as their
> } } disklabel versions. (ie: ffs = 4.2BSD, lfs = 4.4LFS)
> } }
> } } You need to use gpt to create a GPT on the disk, but raidframe devices
> } } do not seem to be supported. If your not using raidframe, then GPT would
> } } seem to give you the flexibility in terms of the number of partitions it
> } } would support as wedges.
> }
> } This is because raidframe doesn't support drvctl. It shouldn't be
> } too hard to add, but I don't have time to do it at this moment. Greg
> } could probably find the correct spot to add the code a lot faster then
> } I could.
>
> The code has now been added. In /usr/src/sys/dev/raidframe can
> you issue the following command:
>
> cvs up -kk -j 1.233 -j 1.234 rf_netbsdkintf.c
>
> You will probably also want
>
> cvs up -kk -j 1.227 -j 1.228 rf_netbsdkintf.c
>
> You will need to add 'pseudo-device drvctl' to your kernel
> configuration. After these steps, you can build and install a new
> kernel. Then in /dev, type './MAKEDEV drvctl'. At this point,
> reboot. At booting, type 'drvctl -p raid0'. You should get some XML
> output describing the geometry of raid0. If this all works, then go
> ahead and try gpt. Let us know how it works out. Thanks.
'drvctl -p raid0' works:
# drvctl -p raid0
Properties for device `raid0':
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>disk-info</key>
<dict>
<key>geometry</key>
<dict>
<key>cylinders-per-unit</key>
<integer>0x2003b</integer>
<key>sector-size</key>
<integer>0x200</integer>
<key>sectors-per-track</key>
<integer>0x80</integer>
<key>sectors-per-unit</key>
<integer>0x800ed80</integer>
<key>tracks-per-cylinder</key>
<integer>0x8</integer>
</dict>
</dict>
</dict>
</plist>
# gpt create raid0
# gpt show raid0
start size index contents
0 1 PMBR
1 1 Pri GPT header
2 32 Pri GPT table
34 134278461
134278495 32 Sec GPT table
134278527 1 Sec GPT header
# gpt add -s 10321920 -t ufs raid0
Partition added, use:
dkctl rraid0d addwedge dk<N> 34 10321920 <type>
to create a wedge for it
# dkctl rraid0d addwedge dk0 34 10321920 ffs
dkctl: rraid0d: No such file or directory
# dkctl raid0 addwedge dk0 34 10321920 ffs
...
but more importantly after a reboot:
raid0: RAID Level 1
raid0: Components: /dev/wd0f /dev/wd1f
raid0: Total Sectors: 134278528 (65565 MB)
raid0: GPT GUID: 79ff036c-8bbc-11dc-b49a-0002b3edf1e9
dk0 at raid0: 79ff0380-8bbc-11dc-b49a-0002b3edf1e9
dk0: 10321920 blocks at 34, type: ffs
...
thanks!
>
> }-- End of excerpt from John Nemeth