免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: ulovko
打印 上一主题 下一主题

[FreeBSD] 【硬盘分区】FreeBSD 移动硬盘分区 [复制链接]

论坛徽章:
4
15-16赛季CBA联赛之北控
日期:2016-12-06 11:11:0115-16赛季CBA联赛之广夏
日期:2016-12-06 15:04:1515-16赛季CBA联赛之四川
日期:2016-12-06 15:59:51黑曼巴
日期:2016-12-09 20:24:05
11 [报告]
发表于 2012-08-31 15:40 |只看该作者
好东西收藏了!可以分成ext4分区不?
Information from DOS bootblock is:
1: sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
2: sysid 7 (0x07),(NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX)
3: sysid 12 (0x0c),(DOS or Windows 95 with 32 bit FAT (LBA))
像这里的
165 是 FreeBSD
7 是 NTFS
12 是 FAT32

这是怎么知道的?有没有一个列表

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
12 [报告]
发表于 2012-08-31 16:15 |只看该作者
回复 11# 方兆国儿

  1. ko# less /usr/src/sbin/fdisk/fdisk.c
  2. /*
  3. * A list of partition types, probably outdated.
  4. */
  5. static const char *const part_types[256] = {
  6.         [0x00] = "unused",
  7.         [0x01] = "Primary DOS with 12 bit FAT",
  8.         [0x02] = "XENIX / file system",
  9.         [0x03] = "XENIX /usr file system",
  10.         [0x04] = "Primary DOS with 16 bit FAT (< 32MB)",
  11.         [0x05] = "Extended DOS",
  12.         [0x06] = "Primary DOS, 16 bit FAT (>= 32MB)",
  13.         [0x07] = "NTFS, OS/2 HPFS, QNX-2 (16 bit) or Advanced UNIX",
  14.         [0x08] = "AIX file system or SplitDrive",
  15.         [0x09] = "AIX boot partition or Coherent",
  16.         [0x0A] = "OS/2 Boot Manager, OPUS or Coherent swap",
  17.         [0x0B] = "DOS or Windows 95 with 32 bit FAT",
  18.         [0x0C] = "DOS or Windows 95 with 32 bit FAT (LBA)",
  19.         [0x0E] = "Primary 'big' DOS (>= 32MB, LBA)",
  20.         [0x0F] = "Extended DOS (LBA)",
  21.         [0x10] = "OPUS",
  22.         [0x11] = "OS/2 BM: hidden DOS with 12-bit FAT",
  23.         [0x12] = "Compaq diagnostics",
  24.         [0x14] = "OS/2 BM: hidden DOS with 16-bit FAT (< 32MB)",
  25.         [0x16] = "OS/2 BM: hidden DOS with 16-bit FAT (>= 32MB)",
  26.         [0x17] = "OS/2 BM: hidden IFS (e.g. HPFS)",
  27.         [0x18] = "AST Windows swapfile",
  28.         [0x1b] = "ASUS Recovery partition (NTFS)",
  29.         [0x24] = "NEC DOS",
  30.         [0x3C] = "PartitionMagic recovery",
  31.         [0x39] = "plan9",
  32.         [0x40] = "VENIX 286",
  33.         [0x41] = "Linux/MINIX (sharing disk with DRDOS)",
  34.         [0x42] = "SFS or Linux swap (sharing disk with DRDOS)",
  35.         [0x43] = "Linux native (sharing disk with DRDOS)",
  36.         [0x4D] = "QNX 4.2 Primary",
  37.         [0x4E] = "QNX 4.2 Secondary",
  38.         [0x4F] = "QNX 4.2 Tertiary",
  39.         [0x50] = "DM (disk manager)",
  40.         [0x51] = "DM6 Aux1 (or Novell)",
  41.         [0x52] = "CP/M or Microport SysV/AT",
  42.         [0x53] = "DM6 Aux3",
  43.         [0x54] = "DM6",
  44.         [0x55] = "EZ-Drive (disk manager)",
  45.         [0x56] = "Golden Bow (disk manager)",
  46.         [0x5c] = "Priam Edisk (disk manager)", /* according to S. Widlake */
  47.         [0x61] = "SpeedStor",
  48.         [0x63] = "System V/386 (such as ISC UNIX), GNU HURD or Mach",
  49.         [0x64] = "Novell Netware/286 2.xx",
  50.         [0x65] = "Novell Netware/386 3.xx",
  51.         [0x70] = "DiskSecure Multi-Boot",
  52.         [0x75] = "PCIX",
  53.         [0x77] = "QNX4.x",
  54.         [0x78] = "QNX4.x 2nd part",
  55.         [0x79] = "QNX4.x 3rd part",
  56.         [0x80] = "Minix until 1.4a",
  57.         [0x81] = "Minix since 1.4b, early Linux partition or Mitac disk manager",
  58.         [0x82] = "Linux swap or Solaris x86",
  59.         [0x83] = "Linux native",
  60.         [0x84] = "OS/2 hidden C: drive",
  61.         [0x85] = "Linux extended",
  62.         [0x86] = "NTFS volume set??",
  63.         [0x87] = "NTFS volume set??",
  64.         [0x93] = "Amoeba file system",
  65.         [0x94] = "Amoeba bad block table",
  66.         [0x9F] = "BSD/OS",
  67.         [0xA0] = "Suspend to Disk",
  68.         [0xA5] = "FreeBSD/NetBSD/386BSD",
  69.         [0xA6] = "OpenBSD",
  70.         [0xA7] = "NeXTSTEP",
  71.         [0xA9] = "NetBSD",
  72.         [0xAC] = "IBM JFS",
  73.         [0xAF] = "HFS+",
  74.         [0xB7] = "BSDI BSD/386 file system",
  75.         [0xB8] = "BSDI BSD/386 swap",
  76.         [0xBE] = "Solaris x86 boot",
  77.         [0xBF] = "Solaris x86 (new)",
  78.         [0xC1] = "DRDOS/sec with 12-bit FAT",
  79.         [0xC4] = "DRDOS/sec with 16-bit FAT (< 32MB)",
  80.         [0xC6] = "DRDOS/sec with 16-bit FAT (>= 32MB)",
  81.         [0xC7] = "Syrinx",
  82.         [0xDB] = "CP/M, Concurrent CP/M, Concurrent DOS or CTOS",
  83.         [0xDE] = "DELL Utilities - FAT filesystem",
  84.         [0xE1] = "DOS access or SpeedStor with 12-bit FAT extended partition",
  85.         [0xE3] = "DOS R/O or SpeedStor",
  86.         [0xE4] = "SpeedStor with 16-bit FAT extended partition < 1024 cyl.",
  87.         [0xEB] = "BeOS file system",
  88.         [0xEE] = "EFI GPT",
  89.         [0xEF] = "EFI System Partition",
  90.         [0xF1] = "SpeedStor",
  91.         [0xF2] = "DOS 3.3+ Secondary",
  92.         [0xF4] = "SpeedStor large partition",
  93.         [0xFE] = "SpeedStor >1024 cyl. or LANstep",
  94.         [0xFF] = "Xenix bad blocks table",
  95. };
复制代码

论坛徽章:
4
15-16赛季CBA联赛之北控
日期:2016-12-06 11:11:0115-16赛季CBA联赛之广夏
日期:2016-12-06 15:04:1515-16赛季CBA联赛之四川
日期:2016-12-06 15:59:51黑曼巴
日期:2016-12-09 20:24:05
13 [报告]
发表于 2012-08-31 17:54 |只看该作者
回复 12# ulovko


    谢谢知道了

论坛徽章:
0
14 [报告]
发表于 2012-08-31 18:21 |只看该作者
不过一个ID。。。你能说你分成的是NTFS?
。。。。。。。。。。
gpart 分区远要比fdisk容易


[ghw@7axu.pts/3] ~ % gpart show
=>       63  625142385  ada0  MBR  (298G)
         63         63        - free -  (31k)
        126  434110383     1  freebsd  [active]  (207G)
  434110509         63        - free -  (31k)
  434110572  191031813     2  ntfs  (91G)
  625142385         63        - free -  (31k)

=>        0  434110383  ada0s1  BSD  (207G)
          0    2097152       1  freebsd-ufs  (1.0G)
    2097152   12582912       2  freebsd-swap  (6.0G)
   14680064  419430319       4  freebsd-zfs  (200G)

[ghw@7axu.pts/3] ~ %

论坛徽章:
0
15 [报告]
发表于 2012-08-31 18:36 |只看该作者
本帖最后由 芭比小柒 于 2012-08-31 18:41 编辑




@ulovko,原来你的那个移动硬盘什么的帖子不知道沉哪了。。。直接接这里吧

哇哈哈。。。

中文问题可能跟内核有关系

     发现。。。ls 出来的文件有公司税号。。。紧急fix之。。。

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
16 [报告]
发表于 2012-08-31 19:13 |只看该作者
回复 14# 芭比小柒


   
不过一个ID。。。你能说你分成的是NTFS?

为什么不能呵 >_<

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
17 [报告]
发表于 2012-08-31 19:16 |只看该作者
本帖最后由 ulovko 于 2012-08-31 20:16 编辑

@芭比小柒
gpart 分区远要比fdisk容易

请教仁兄具体是怎么操作的呵 ^_^

请教 @zeissoctopus  @gvim  兄,gpart 如何创建NTFS 分区 ^_^

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
18 [报告]
发表于 2012-08-31 19:25 |只看该作者
回复 15# 芭比小柒


    我的编码是UTF-8 ^_^

论坛徽章:
13
15-16赛季CBA联赛之同曦
日期:2016-01-28 19:52:032015亚冠之北京国安
日期:2015-10-07 14:28:19NBA常规赛纪念章
日期:2015-05-04 22:32:03处女座
日期:2015-01-15 19:45:44卯兔
日期:2014-10-28 16:17:14白羊座
日期:2014-05-24 15:10:46寅虎
日期:2014-05-10 09:50:35白羊座
日期:2014-03-12 20:52:17午马
日期:2014-03-01 08:37:27射手座
日期:2014-02-19 19:26:54子鼠
日期:2013-11-30 09:03:56狮子座
日期:2013-09-08 08:37:52
19 [报告]
发表于 2012-08-31 19:53 |只看该作者
本帖最后由 ulovko 于 2012-08-31 21:55 编辑

创建 UFS:
  1. ko# gpart show da0
  2. =>       63  976773105  da0  MBR  (465G)
  3.          63  488384064    1  freebsd  [active]  (232G)
  4.   488384127  488367873    2  ntfs  (232G)
  5.   976752000      21168       - free -  (10M)

  6. ko# gpart destroy -F da0
  7. da0 destroyed
  8. ko# gpart create -s gpt da0
  9. da0 created
  10. ko# gpart add -t freebsd-ufs -l koufs -s 250G da0
  11. da0p1 added
  12. ko# gpart show da0
  13. =>       34  976773101  da0  GPT  (465G)
  14.          34  524288000    1  freebsd-ufs  (250G)
  15.   524288034  452485101       - free -  (215G)
  16. > gpart show -l da0
  17. =>       34  976773101  da0  GPT  (465G)
  18.          34  524288000    1  koufs  (250G)
  19.   524288034  452485101       - free -  (215G)

复制代码
创建 UFS + NTFS:
  1. ko#  gpart destroy -F da0
  2. da0 destroyed

  3. ko# gpart create -s MBR da0
  4. da0 created
  5. ko# gpart show da0
  6. =>       63  976773105  da0  MBR  (465G)
  7.          63  976773105       - free -  (465G)

  8. ko# gpart add -t freebsd -s 250G da0
  9. da0s1 added
  10. ko# gpart show da0
  11. =>       63  976773105  da0  MBR  (465G)
  12.          63  524287953    1  freebsd  (250G)
  13.   524288016  452485152       - free -  (215G)

  14. ko# gpart add -t ntfs da0
  15. da0s2 added
  16. ko# gpart show da0
  17. =>       63  976773105  da0  MBR  (465G)
  18.          63  524287953    1  freebsd  (250G)
  19.   524288016  452485152    2  ntfs  (215G)

  20. ko# gpart create -s bsd da0s1
  21. da0s1 created

  22. ko# gpart show da0s1
  23. =>        0  524287953  da0s1  BSD  (250G)
  24.           0  524287953         - free -  (250G)

  25. ko# gpart add -t freebsd-ufs da0s1
  26. da0s1a added

  27. ko# mount /dev/da0s1a /media/

  28. ko# df
  29. Filesystem     Size    Used   Avail Capacity  Mounted on
  30. /dev/ada0p2    9.9G    649M    8.4G     7%    /
  31. devfs          1.0k    1.0k      0B   100%    /dev
  32. /dev/ada0p4    118G     26G     82G    24%    /var
  33. /dev/ada0p5      2G     23M    1.8G     1%    /tmp
  34. /dev/ada0p6    118G     45G     63G    42%    /usr
  35. /dev/ada0p7    103G     64G     31G    67%    /usr/home
  36. /dev/da0s1a    246G    8.0k    226G     0%    /media
  37. /dev/fuse0     215G     71M    215G     0%    /mnt

  38. ko# mount
  39. /dev/ada0p2 on / (ufs, local, journaled soft-updates)
  40. devfs on /dev (devfs, local, multilabel)
  41. /dev/ada0p4 on /var (ufs, local, journaled soft-updates)
  42. /dev/ada0p5 on /tmp (ufs, local, journaled soft-updates)
  43. /dev/ada0p6 on /usr (ufs, local, journaled soft-updates)
  44. /dev/ada0p7 on /usr/home (ufs, local, journaled soft-updates)
  45. /dev/da0s1a on /media (ufs, local, soft-updates)
  46. /dev/fuse0 on /mnt (fusefs, local, synchronous)

  47. ko# gpart show
  48. =>       34  976773101  ada0  GPT  (465G)
  49.          34       1024     1  freebsd-boot  (512k)
  50.        1058   20971520     2  freebsd-ufs  (10G)
  51.    20972578   16777216     3  freebsd-swap  (8.0G)
  52.    37749794  251658240     4  freebsd-ufs  (120G)
  53.   289408034    4194304     5  freebsd-ufs  (2.0G)
  54.   293602338  251658240     6  freebsd-ufs  (120G)
  55.   545260578  220200960     7  freebsd-ufs  (105G)
  56.   765461538  209715200     8  freebsd-ufs  (100G)
  57.   975176738    1596397        - free -  (779M)

  58. =>       63  976773105  da0  MBR  (465G)
  59.          63  524287953    1  freebsd  (250G)
  60.   524288016  452485152    2  ntfs  (215G)

  61. =>        0  524287953  da0s1  BSD  (250G)
  62.           0  524287953      1  freebsd-ufs  (250G)
复制代码
=======================================================
  1. # more /sys/geom/part/g_part.c
  2. struct g_part_alias_list {
  3.         const char *lexeme;
  4.         enum g_part_alias alias;
  5. } g_part_alias_list[G_PART_ALIAS_COUNT] = {
  6.         { "apple-boot", G_PART_ALIAS_APPLE_BOOT },
  7.         { "apple-hfs", G_PART_ALIAS_APPLE_HFS },
  8.         { "apple-label", G_PART_ALIAS_APPLE_LABEL },
  9.         { "apple-raid", G_PART_ALIAS_APPLE_RAID },
  10.         { "apple-raid-offline", G_PART_ALIAS_APPLE_RAID_OFFLINE },
  11.         { "apple-tv-recovery", G_PART_ALIAS_APPLE_TV_RECOVERY },
  12.         { "apple-ufs", G_PART_ALIAS_APPLE_UFS },
  13.         { "bios-boot", G_PART_ALIAS_BIOS_BOOT },
  14.         { "ebr", G_PART_ALIAS_EBR },
  15.         { "efi", G_PART_ALIAS_EFI },
  16.         { "fat32", G_PART_ALIAS_MS_FAT32 },
  17.         { "freebsd", G_PART_ALIAS_FREEBSD },
  18.         { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT },
  19.         { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP },
  20.         { "freebsd-ufs", G_PART_ALIAS_FREEBSD_UFS },
  21.         { "freebsd-vinum", G_PART_ALIAS_FREEBSD_VINUM },
  22.         { "freebsd-zfs", G_PART_ALIAS_FREEBSD_ZFS },
  23.         { "linux-data", G_PART_ALIAS_LINUX_DATA },
  24.         { "linux-lvm", G_PART_ALIAS_LINUX_LVM },
  25.         { "linux-raid", G_PART_ALIAS_LINUX_RAID },
  26.         { "linux-swap", G_PART_ALIAS_LINUX_SWAP },
  27.         { "mbr", G_PART_ALIAS_MBR },
  28.         { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA },
  29.         { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA },
  30.         { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA },
  31.         { "ms-reserved", G_PART_ALIAS_MS_RESERVED },
  32.         { "ntfs", G_PART_ALIAS_MS_NTFS },
  33.         { "netbsd-ccd", G_PART_ALIAS_NETBSD_CCD },
  34.         { "netbsd-cgd", G_PART_ALIAS_NETBSD_CGD },
  35.         { "netbsd-ffs", G_PART_ALIAS_NETBSD_FFS },
  36.         { "netbsd-lfs", G_PART_ALIAS_NETBSD_LFS },
  37.         { "netbsd-raid", G_PART_ALIAS_NETBSD_RAID },
  38.         { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP },
  39. };
复制代码
  1. PARTITION TYPES
  2.      Partition types are identified on disk by particular strings or magic
  3.      values.  The gpart utility uses symbolic names for common partition types
  4.      to avoid the user needing to know these values or other details of the
  5.      partitioning scheme in question.  The gpart utility also allows the user
  6.                            about its use.

  7. PARTITION TYPES
  8.      Partition types are identified on disk by particular strings or magic
  9.      values.  The gpart utility uses symbolic names for common partition types
  10.      to avoid the user needing to know these values or other details of the
  11.      partitioning scheme in question.  The gpart utility also allows the user
  12.      to specify scheme-specific partition types for partition types that do
  13.      not have symbolic names.  The symbolic names currently understood are:

  14.      bios-boot      The system partition dedicated to second stage of the boot
  15.                     loader program.  Usually it used by GRUB 2 loader when the
  16.                     partition table is GPT.  The scheme-specific type is
  17.                     "!21686148-6449-6E6F-744E-656564454649".

  18.      efi            The system partition for computers that use the Extensible
  19.                     Firmware Interface (EFI).  In such cases, the GPT parti‐
  20.                     tioning scheme is being used and the actual partition type
  21.                     for the system partition can also be specified as
  22.                     "!c12a7328-f81f-11d2-ba4b-00a0c93ec93ab".

  23.      freebsd        A FreeBSD partition that uses the BSD disklabel to sub-
  24.                     divide the partition into file systems.  This is a legacy
  25.                     partition type and should not be used for the APM or GPT
  26.                     schemes.  The scheme-specific types are "!165" for MBR,
  27.                     "!FreeBSD" for APM, and
  28.                     "!516e7cb4-6ecf-11d6-8ff8-00022d09712b" for GPT.

  29.      freebsd-boot   A FreeBSD partition dedicated to bootstrap code.  The
  30.                     scheme-specific type is
  31.                     "!83bd6b9d-7f41-11dc-be0b-001560b84f0f" for GPT.

  32.      freebsd-swap   A FreeBSD partition dedicated to swap space.  The scheme-
  33.                     specific types are "!FreeBSD-swap" for APM,
  34.                     "!516e7cb5-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag
  35.                     0x0901 for VTOC8.

  36.      freebsd-ufs    A FreeBSD partition that contains a UFS or UFS2 file sys‐
  37.                     tem.  The scheme-specific types are "!FreeBSD-UFS" for
  38.                     APM, "!516e7cb6-6ecf-11d6-8ff8-00022d09712b" for GPT, and
  39.                     tag 0x0902 for VTOC8.

  40.      freebsd-vinum  A FreeBSD partition that contains a Vinum volume.  The
  41.                     scheme-specific types are "!FreeBSD-Vinum" for APM,
  42.                     "!516e7cb8-6ecf-11d6-8ff8-00022d09712b" for GPT, and tag
  43.                     0x0903 for VTOC8.

  44.      freebsd-zfs    A FreeBSD partition that contains a ZFS volume.  The
  45.                     scheme-specific types are "!FreeBSD-ZFS" for APM,
  46.                     "!516e7cba-6ecf-11d6-8ff8-00022d09712b" for GPT, and
  47.                     0x0904 for VTOC8.

  48.      mbr            A partition that is sub-partitioned by a master boot
  49.                     record (MBR).  This type is known as
  50.                     "!024dee41-33e7-11d3-9d69-0008c781f39f" by GPT.
复制代码

  1. > man gpart
  2. EXAMPLES
  3.      Create GPT scheme on ad0:

  4.            /sbin/gpart create -s GPT ad0

  5.      Embed GPT bootstrap code into protective MBR:

  6.            /sbin/gpart bootcode -b /boot/pmbr ad0

  7.      Create a dedicated freebsd-boot partition that can boot FreeBSD from a
  8.      freebsd-ufs partition, and install bootstrap code into it.  This parti‐
  9.      tion must be larger than /boot/gptboot, or the GPT boot you are planning
  10.      to write, but smaller than 545 KB.  A size of 15 blocks (7680 bytes)
  11.      would be sufficient for booting from UFS but let's use 128 blocks (64 KB)
  12.      here in this example, in order to reserve some space for potential future
  13.      need (e.g. from a ZFS partition).

  14.            /sbin/gpart add -b 34 -s 128 -t freebsd-boot ad0
  15.            /sbin/gpart bootcode -p /boot/gptboot -i 1 ad0

  16.      Create a 512MB-sized freebsd-ufs partition that would contain UFS where
  17.      the system boots from:

  18.            /sbin/gpart add -b 162 -s 1048576 -t freebsd-ufs ad0

  19.      Create MBR scheme on ada0, then create 30GB-sized FreeBSD slice, mark it
  20.      active and install boot0 boot manager:

  21.            /sbin/gpart create -s MBR ada0
  22.            /sbin/gpart add -t freebsd -s 30G ada0
  23.            /sbin/gpart set -a active -i 1 ada0
  24.            /sbin/gpart bootcode -b /boot/boot0 ada0

  25.      Now create BSD scheme (BSD label) with ability to have up to 20 parti‐
  26.      tions:

  27.            /sbin/gpart create -s BSD -n 20 ada0s1

  28.      Create 1GB-sized UFS partition and 4GB-sized swap partition:

  29.            /sbin/gpart add -t freebsd-ufs -s 1G ada0s1
  30.            /sbin/gpart add -t freebsd-swap -s 4G ada0s1

  31.      Install bootstrap code for the BSD label:

  32.            /sbin/gpart bootcode -b /boot/boot ada0s1

  33.      Create VTOC8 scheme on da0:

  34.            /sbin/gpart create -s VTOC8 da0

  35.      Create a 512MB-sized freebsd-ufs partition that would contain UFS where
  36.      the system boots from:

  37.            /sbin/gpart add -s 512M -t freebsd-ufs da0

  38.      Create a 15GB-sized freebsd-ufs partition that would contain UFS and
  39.      aligned on 4KB boundaries:

  40.            /sbin/gpart add -s 15G -t freebsd-ufs -a 4k da0

  41.      After having created all required partitions, embed bootstrap code into
  42.      them:

  43.            /sbin/gpart bootcode -p /boot/boot1 da0

  44.      Create backup of partition table from da0:

  45.            /sbin/gpart backup da0 > da0.backup

  46.      Restore partition table from backup to da0:

  47.            /sbin/gpart restore -l da0 < /mnt/da0.backup

  48.      Clone partition table from ada0 to ada1 and ada2:

  49.            /sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2
复制代码
=======================================================================
FROM: http://lists.freebsd.org/piperma ... 11-July/232374.html
On 7/28/2011 7:55 AM, Kevin Oberman wrote:
> I want to create a GPT disk structure that has the following partitions:
> MBR
> NTFS (1.2G)
> NTFS (200G)
> FreeBSD OS (250G)
> NTFS (15G)
> FAT-32 (100G) (needs to be RW for W7 and FreeBSD and ntfs-3g is just
> not stable enough)
> FreeBSD data only (380G)
>
> The NTFS partitions are to place the Windows7 system, recovery
> partition (which I may
> not use), and Lenovo's odd "SYSTEM_DRV" that is required for booting.
> gpart has no
> indications of how to create an NTFS or FAT partition. Any way to so
> this? Or, should I
> use W7 to do that and leave the space for the FreeBSD ones?

No, you can do this with gpart.

gpart knows the following MS related GUIDs. The types you need
to use in -t are ms-basic-data, ms-ldm-data etc.

>         { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA },
>         { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA },
>         { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA },
>         { "ms-reserved", G_PART_ALIAS_MS_RESERVED },
>         { "ntfs", G_PART_ALIAS_MS_NTFS },

I don't know which partition types you should use for the
wanted partitioning scheme.

The struct that defines the known gpart GUIDs is in
/sys/geom/part/g_part.c at line 69(on HEAD).

HTH, Nikos

论坛徽章:
0
20 [报告]
发表于 2012-08-31 21:14 |只看该作者
回复 18# ulovko


    [ghw@7axu.pts/3] ~ % locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_ALL=zh_CN.UTF-8
[ghw@7axu.pts/3] ~ %


看起来。。。
我也是UTF-8
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP