📄 chpt.8
字号:
.\" SCCSID: @(#)chpt.8 8.1 9/11/90.TH chpt 8 .SH Namechpt \- change a disk partition table.SH Syntax.B /etc/chpt[ \fB\-a\fR ][ \fB\-d\fR ][ \fB\-q\fR ][ \fB\-v\fR ][ [ \fB\-p\fR\fIx\fR \fIoffset\fR \fIsize\fR ] ... ].I device.SH Description.NXB "chpt command".NXB "disk partition table" "changing".NXR "disk partition table" "changing procedure"The.PN chptcommand lets you alter the partition sizesof a disk pack. Using .PN chpt, you can tailor your system disks and theirpartitions to suit your system's individual needs..PPIf you want to create a file system on a partition that has beenmodified, you must use .MS newfs 8 ..PPThe standard procedure to change a partition table is:.IP "1." 0.3iLook at the current partition table using the \fB\-q\fRoption..IP "2." 0.3iIf a file system does not exist on the \fIa\fR partition, createone using the .MS newfs 8 command..IP "" 0.3iIf a file system exists on the \fIa\fR partition but doesnot contain a partition table in its superblock, copy thepartition table from the driver to the superblock usingthe.PN chptcommandwith the \fB\-a\fR option..IP "3." 0.3iChange the partition offsets and sizes using the \fB\-p\fIx\fRoption. You can change all the partitions for one pack on onecommand line..PPThe devicemust be either the \fIa\fR or \fIc\fR partition of the rawdevice, depending upon where the file system resides. Forexample, if the file system resides in the \fIa\fRpartition of an RM05 in drive 0, \fIdevice\fR isrhp0a..PPA file system must exist on the \fIa\fR or \fIc\fR partitionof the pack. If you do not have a file system there, create oneusing .MS newfs 8 ..SH Options.NXR "chpt command" "options".IP \fB\-a\fR 6Copies the partition table in the device driverto the disk pack..IP \fB\-d\fR 6Copies the default partition tableto the disk pack and to the current partition table in the driver.The default partition table is the table that was built with the disk driver..IP \fB\-q\fRRuns.PN chptwithout modifying the partition tables.This prints the partition table of the specified disk pack. It prints the default partition table in the driver if thereis no partition table on the disk pack..IP \fB\-v\fRPrints verbose messages showingthe progress of .PN chpt ..IP \fB\-p\fR\fIx\fRChanges the parameters of partition \fIx\fR on the disk packto the specified \fIoffset\fR and \fIsize\fR.\fIx\fR is the partition you are modifying (a, b, c, d, e, f, g, or h).\fIOffset\fR is the new beginning sector,and \fIsize\fR is the new total number of sectors of the partitionbeing modified..SH Examples.NXR(e) "disk partition table" "changing"This example shows how to change the partition table on an RM05disk pack in drive 1.The commands in this example change the the size of the \fIh\fRpartition to include the \fIg\fR partition.Comments are in parenthesis to the right of commands..EX 0.ta 2.5i% chpt \-q /dev/rhp1a (\fRview partition table\fP)/dev/rhp1aNo partition table found in superblock...using default table from device driver.Current partition table:partition bottom top size overlap a 0 15883 15884 c b 16416 49855 33440 c c 0 500383 500384 a,b,d,e,f,g,h d 341696 357579 15884 c,g e 358112 414047 55936 c,g f 414048 500287 86240 c,g g 341696 500287 158592 c,d,e,f h 49856 341201 291346 c%.EE.NTIn all of the tables generated by .PN chpt ,\fIbottom\fR is the offset (starting sector),\fItop\fR is the ending sector,and \fIsize\fR is the number of sectors in the partition.The \fIoverlap\fR is the other sectors that are partiallyor entirely included in the partition..NE.EX 0.ta 2i% bc (\fRbasic calculator\fP)500287-49856 (\fRtop of \fIg\fR minus bottom of \fIh\fR\f(CW)450431450431+1 (\fRadd 1 because it is zero\-based\fP)450432 (\fRsize of new \fIh\fR partition\f(CW)%.EE.PPFrom the query,you can see that there is no partition table in the superblockof the \fIa\fR partition.If this is because there is no file system in the \fIa\fRpartition,run the .PN newfscommand to create one..PPFor this example,assume that there is a file system in the \fIa\fR partition of the disk,but the file system does not contain a partition table in itssuperblock.Therefore, run .PN chptwith the \fB\-a\fR option to copy the partition tablein the driver to the superblock of the \fIa\fR partition..EX 0.ta 2.5i% chpt \-a /dev/rhp1a (\fRadd table to \fIa\fR partition\f(CW)%.EE.PPNow you have a partition table to change..EX 0.ta 4i% chpt \-v \-ph 49856 450432 /dev/rhp1a (\fRchange \fIh\fR\f(CW)/dev/rhp1aNew partition table:partition bottom top size overlap a 0 15883 15884 c b 16416 49855 33440 c c 0 500383 500384 a,b,d,e,f,g,h d 341696 357579 15884 c,g,h e 358112 414047 55936 c,g,h f 414048 500287 86240 c,g,h g 341696 500287 158592 c,d,e,f,h h 49856 500287 450432 c,d,e,f,g%.EE.PP.SH Caution.NXR(c) "disk partition table" "changing indiscriminately"Changing partition tables indiscriminatelycan result in losing large amounts of data..PPCheck for file systems on all the partitions of the diskbefore using the \fB\-p\fR option.If a file system exists whose partition may be destroyed,copy it to a backup medium.After you have changed the partitions,restore the backed up file system..SH Restrictions.NXR "chpt command" "restricted"You must have superuser privileges to use.PN chpt ..PP You can not shrink or change the offset of a partitionwith a file system mounted on itor with an open file descriptor on the entire partition..PPYou can not change the offset of the \fIa\fR partition..SH See Alsoioctl(2), disktab(5), fsck(8), mkfs(8), newfs(8).br.I "Guide to System Disk Maintenance".NXE "chpt command".NXE "disk partition table" "changing"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -