免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 801 | 回复: 0
打印 上一主题 下一主题

linux下的fdisk mkfs and mkswap commands [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-08-23 16:49 |只看该作者 |倒序浏览

               
               
                fdisk:
/sbin/fdisk  this is the real path.version redhat 9.0
only superuser have the permission to running the command
frequently used commands
  a toggle(触发器,系紧) the bootable on/off for a primary partition
d delete a partition.you are prompted for the partition number to delete.if you delete a logical partition when higher numbered logical partitions exist.the partition numbers are decremented(减少,减少量,渐减) to keep logical partition numbers contiguous.
  l  list the known partion types. a table of partition types is printed
  m display the primary help menu for those commands
  n add a new partition.you are prompted for the partition type(primary,extended,or logical),for primary and extended partitions,you are asked for the partition(1-4).for logical partitions.the next logical partiton number is selected automatically.
  p display the partition table as it exists in memory.this depiction wil differ from the actual partition table on disk if change have not been saved.
  t change a partition's system ID,this is an octal number that indicates the type of filesystem the partition is to contain. linux ext2 partitions are type 83,and linux swap partition are type 82.
  w write(save) the partition table to disk and exit. no changes are saved until the w command is issued.
  example
  #/sbin/fsck /dev/hdc
  command (m for help) :p
  .....
  command (m for help) :q
  example 2
  #/sbin/fsck /dev/hdc
  command (m for help) :n
  e extended
  p primary partition(1-4)
  p
  partiton number(1-4):1
  first cylinder(..):
  using default value
  last cylinder or +size or sizeM or +sizeK(..):300M
  command (m for help) :a
  partition number(1-4):1
  command (m for help) :n
  e extended
  p primary partition(1-4)
  e
  partition number(1-4):2
  first cylinder(..):
   using default value
   last cylinder or +size or sizeM or +sizeK(..):
   use the default value
   command (m for help) :n
   command action
    1 logical(5 or over)
    p primary partition(1-4)
    1
    first cylinder(..):
   using default value
   last cylinder or +size or sizeM or +sizeK(..):+200M
   command (m for help) :n
   command action
    1 logical(5 or over)
    p primary partition(1-4)
    1
    first cylinder(..):
   using default value
   last cylinder or +size or sizeM or +sizeK(..):+200M
   command (m for help) :t
   partition number(1-6):6
   hex code(type L to list codes):82
   change system type of partition 6 to 82(linux swap)
   command (m for help) :n
   command action
    1 logical(5 or over)
    p primary partition(1-4)
    1
    first cylinder(..):
   using default value
   last cylinder or +size or sizeM or +sizeK(..):
   use the default value
   command (m for help) :p
   ,.......
   command (m for help) :w
   #
   note the use of default for the partition start cylinders(柱面) and for end cylinder selections, indicated by  in the example. other partition sizes are specified in megabytes using responses such as +128M
   
mkfs
/sbin/mkfs   this is the real path
make a filesystem of type fstype on device.the fs-type is either ext2 or msdos.
-c check device for bad blocks(mke2fs and mkdosfs)
-L label  set the volume label for the filesystem(mke2fs only)
-n tabel  set the 11-character volume label for the filesystem(mkdosfs only)
-q uses mkfs in quiet mode.resulting in very little output(mke2fs only)
-v used to enter vervose mode(mke2fs and mkdosfs)
example /sbin/mikfs -t ext2 -L rootfs -cv /dev/hda3
create an ext2 filesystem labeled rootfs on exiting partiong /dev/hda3.checking for bad blocks and with full verbose output.

mkswap  
  note the command I can't find on my pc(version is redhat 9.0)
  description:  
prepare a partition for use an swap space. this command can also set up swap space in a file on another filesystem.
example:
$mkswap /dev/hda5


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/45689/showart_366194.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP