首页 | 邮件资讯 | 技术教程 | 解决方案 | 产品评测 | 邮件人才 | 邮件博客 | 邮件系统论坛 | 软件下载 | 邮件周刊 | 热点专题 | 工具
网络技术 | 操作系统 | 邮件系统 | 客户端 | 电子邮箱 | 反垃圾邮件 | 邮件安全 | 邮件营销 | 移动电邮 | 邮件软件下载 | 电子书下载

操作系统

Windows 9X | Linux&Uinx | Windows Server | 其它操作系统 | Vista | FreeBSD | Windows 7 |
首页 > 操作系统 > Linux&Uinx > 介绍Linux操作系统下添加新硬盘的方法 > 正文

介绍Linux操作系统下添加新硬盘的方法

出处:5DMail.Net收集整理 作者:5DMail.Net收集整理 时间:2007-7-1 21:21:45
   在系统上增加硬盘操作办法

        [root@gyhredhat root]# fdisk

        Usage: fdisk [-l] [-b SSZ] [-u] device

        E.g.: fdisk /dev/hda (for the first IDE disk)

        or: fdisk /dev/sdc (for the third SCSI disk)

        or: fdisk /dev/eda (for the first PS/2 ESDI drive)

        or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)

        ……

        [root@gyhredhat root]# df -k

        文件系统 1K-块 已用 可用 已用% 挂载点

        /dev/sda3 3723848 705968 2828716 20% /

        /dev/sda1 101089 9274 86596 10% /boot

        none 14520 0 14520 0% /dev/shm

        对新硬盘分区,4G硬盘中划出1G作为新分区。给/home使用

        [root@gyhredhat root]# fdisk /dev/hda

        Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

        Building a new DOS disklabel. Changes will remain in memory only,

        until you decide to write them. After that, of course, the previous

        content won't be recoverable.

        The number of cylinders for this disk is set to 8322.

        There is nothing wrong with that, but this is larger than 1024,

        and could in certain setups cause problems with:

        1) software that runs at boot time (e.g., old versions of LILO)

        2) booting and partitioning software from other OSs

        (e.g., DOS FDISK, OS/2 FDISK)

        Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

        Command (m for help): p

        Disk /dev/hda: 4294 MB, 4294967296 bytes

        16 heads, 63 sectors/track, 8322 cylinders

        Units = cylinders of 1008 * 512 = 516096 bytes

        Device Boot Start End Blocks Id System

        Command (m for help): m

        Command action

        a toggle a bootable flag

        b edit bsd disklabel

        c toggle the dos compatibility flag

        d delete a partition

        l list known partition types

        m print this menu

        n add a new partition

        o create a new empty DOS partition table

        p print the partition table

        q quit without saving changes

        s create a new empty Sun disklabel

        t change a partition's system id

        u change display/entry units

        v verify the partition table

        w write table to disk and exit

        x extra functionality (experts only)

        Command (m for help): n

        Command action

        e extended

        p primary partition (1-4)

        p

        Partition number (1-4): 1

        First cylinder (1-8322, default 1):

        Using default value 1

        Last cylinder or +size or +sizeM or +sizeK (1-8322, default 8322): 1000G

        Command (m for help): p

        Disk /dev/hda: 4294 MB, 4294967296 bytes

        16 heads, 63 sectors/track, 8322 cylinders

        Units = cylinders of 1008 * 512 = 516096 bytes

        Device Boot Start End Blocks Id System

        /dev/hda1 1 1000 503968+ 83 Linux

        Command (m for help): w

        The partition table has been altered!

        Calling ioctl() to re-read partition table.

        Syncing disks.
      //格式化新分区

        [root@gyhredhat root]# mkfs.ext3 /dev/hda1

        mke2fs 1.32 (09-Nov-2002)

        Filesystem label=

        OS type: Linux

        Block size=1024 (log=0)

        Fragment size=1024 (log=0)

        126480 inodes, 503968 blocks

        25198 blocks (5.00%) reserved for the super user

        First data block=1

        62 block groups

        8192 blocks per group, 8192 fragments per group

        2040 inodes per group

        Superblock backups stored on blocks:

        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409

        Writing inode tables: done

        Creating journal (8192 blocks): done

        Writing superblocks and filesystem accounting information: done

        This filesystem will be automatically checked every 30 mounts or

        180 days, whichever comes first. Use tune2fs -c or -i to override.

        [root@gyhredhat root]# df -k

        文件系统 1K-块 已用 可用 已用% 挂载点

        /dev/sda3 3723848 705992 2828692 20% /

        /dev/sda1 101089 9274 86596 10% /boot

        none 14520 0 14520 0% /dev/shm

        //挂上新分区

        [root@gyhredhat root]# mount /dev/hda1 /home

        [root@gyhredhat root]# df -k

        文件系统 1K-块 已用 可用 已用% 挂载点

        /dev/sda3 3723848 705992 2828692 20% /

        /dev/sda1 101089 9274 86596 10% /boot

        none 14520 0 14520 0% /dev/shm

        /dev/hda1 488006 8239 454569 2% /home

        [root@gyhredhat root]#

        以下是为收集于网络,个人觉得非常不错

        1. 检查所有硬盘分区

        [root@web home]# fdisk -l

        Disk /dev/hdc: 81.9 GB, 81964302336 bytes

        255 heads, 63 sectors/track, 9964 cylinders

        Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot Start End Blocks Id System

        /dev/hdc1 * 1 3921 31495401 7 HPFS/NTFS

        /dev/hdc2 3922 9964 48540397+ f Win95 Ext'd (LBA)

        /dev/hdc5 3922 7840 31479336 7 HPFS/NTFS

        /dev/hdc6 7841 9964 17060998+ 7 HPFS/NTFS

        Disk /dev/hda: 60.0 GB, 60022480896 bytes

        255 heads, 63 sectors/track, 7297 cylinders

        Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot Start End Blocks Id System

        /dev/hda1 * 1 13 104391 83 Linux

        /dev/hda2 14 7043 56468475 83 Linux

        /dev/hda3 7044 7297 2040255 82 Linux swap

        2. 检查新硬盘分区

        [root@web root]# fdisk /dev/hdc

        The number of cylinders for this disk is set to 9964.

        There is nothing wrong with that, but this is larger than 1024,

        and could in certain setups cause problems with:

        1) software that runs at boot time (e.g., old versions of LILO)

        2) booting and partitioning software from other OSs

        (e.g., DOS FDISK, OS/2 FDISK)
  3. 删除老硬盘分区(hdc1,hdc2,hdc5,hdc6)

        Command (m for help): d

        Partition number (1-6): 6

        4. 保存修改信息

        Command (m for help): w

        The partition table has been altered!

        Calling ioctl() to re-read partition table.

        Syncing disks.

        5. 检查保存情况,直到所有老分区都删除

        [root@web root]# fdisk -l /dev/hdc

        Disk /dev/hdc: 81.9 GB, 81964302336 bytes

        255 heads, 63 sectors/track, 9964 cylinders

        Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot Start End Blocks Id System

        /dev/hdc2 3922 9964 48540397+ f Win95 Ext'd (LBA)

        /dev/hdc5 3922 7840 31479336 7 HPFS/NTFS

        6. 重新创建硬盘分区

        [root@web root]# fdisk -l /dev/hdc

        Disk /dev/hdc: 81.9 GB, 81964302336 bytes

        255 heads, 63 sectors/track, 9964 cylinders

        Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot Start End Blocks Id System

        Command (m for help): d

        No partition is defined yet!

        Command (m for help): n

        Command action

        e extended

        p primary partition (1-4)

        7. 选择主分区(?)

        p

        8. 选择硬盘分区号(hdc1中的1)

        Partition number (1-4): 1

        9. 选择硬盘分区的第一柱面(从第2个开始,从1开始不安全(?))

        First cylinder (1-9964, default 1): 2

        10. 选择硬盘分区结束柱面

        Last cylinder or +size or +sizeM or +sizeK (2-9964, default 9964): 5000

        11. 保存修改信息

        Command (m for help): w

        The partition table has been altered!

        Calling ioctl() to re-read partition table.

        Syncing disks.

        12. 创建hdc2

        [root@web root]# fdisk /dev/hdc

        The number of cylinders for this disk is set to 9964.

        There is nothing wrong with that, but this is larger than 1024,

        and could in certain setups cause problems with:

        1) software that runs at boot time (e.g., old versions of LILO)

        2) booting and partitioning software from other OSs

        (e.g., DOS FDISK, OS/2 FDISK)

        Command (m for help): n

        Command action

        e extended

        p primary partition (1-4)

        p

        Partition number (1-4): 2

        First cylinder (1-9964, default 1): 5001

        Last cylinder or +size or +sizeM or +sizeK (5001-9964, default 9964):

        Using default value 9964

        Command (m for help): w

        The partition table has been altered!

        Calling ioctl() to re-read partition table.

        Syncing disks.
 13. 检查新硬盘创建信息

        [root@web root]# fdisk -l

        Disk /dev/hdc: 81.9 GB, 81964302336 bytes

        255 heads, 63 sectors/track, 9964 cylinders

        Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot Start End Blocks Id System

        /dev/hdc1 2 5000 40154467+ 83 Linux

        /dev/hdc2 5001 9964 39873330 83 Linux

        Disk /dev/hda: 60.0 GB, 60022480896 bytes

        255 heads, 63 sectors/track, 7297 cylinders

        Units = cylinders of 16065 * 512 = 8225280 bytes

        Device Boot Start End Blocks Id System

        /dev/hda1 * 1 13 104391 83 Linux

        /dev/hda2 14 7043 56468475 83 Linux

        /dev/hda3 7044 7297 2040255 82 Linux swap

        14. 建立新硬盘映射目录

        [root@web root]# mkdir -pv /disk1

        [root@web root]# mkdir -pv /disk2

        15. 格式化新硬盘分区

        [root@web root]# mkfs.ext3 /dev/hdc1

        mke2fs 1.32 (09-Nov-2002)

        Filesystem label=

        OS type: Linux

        Block size=4096 (log=2)

        Fragment size=4096 (log=2)

        5020064 inodes, 10038616 blocks

        501930 blocks (5.00%) reserved for the super user

        First data block=0

        307 block groups

        32768 blocks per group, 32768 fragments per group

        16352 inodes per group

        Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624

        Writing inode tables: done

        Creating journal (8192 blocks): done

        Writing superblocks and filesystem accounting information: done

        This filesystem will be automatically checked every 28 mounts or

        180 days, whichever comes first. Use tune2fs -c or -i to override.

        [root@web root]# mkfs.ext3 /dev/hdc2

        mke2fs 1.32 (09-Nov-2002)

        Filesystem label=

        OS type: Linux

        Block size=4096 (log=2)

        Fragment size=4096 (log=2)

        4987360 inodes, 9968332 blocks

        498416 blocks (5.00%) reserved for the super user

        First data block=0

        305 block groups

        32768 blocks per group, 32768 fragments per group

        16352 inodes per group

        Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

        4096000, 7962624

        Writing inode tables: done

        Creating journal (8192 blocks): done

        Writing superblocks and filesystem accounting information: done

        This filesystem will be automatically checked every 29 mounts or

        180 days, whichever comes first. Use tune2fs -c or -i to override.

        16. 增加新硬盘分区表信息

        [root@web root]# vi /etc/fstab

        LABEL=/ / ext3 defaults 1 1

        LABEL=/boot /boot ext3 defaults 1 2

        none /dev/pts devpts gid=5,mode=620 0 0

        none /proc proc defaults 0 0

        none /dev/shm tmpfs defaults 0 0

        /dev/hda3 swap swap defaults 0 0

        /dev/hdc1 /disk1 ext3 defaults 1 1

        /dev/hdc2 /disk2 ext3 defaults 1 1

        17. 挂上硬盘

        [root@web root]# mount -a

        18. 检查所有硬盘mount情况

        [root@web root]# df -h

        /dev/hda2 54G 1.4G 49G 3% /

        /dev/hda1 99M 15M 80M 16% /boot

        none 1008M 0 1008M 0% /dev/shm

        /dev/hdc1 38G 33M 36G 1% /disk1

        /dev/hdc2 38G 33M 36G 1% /disk2

相关文章 热门文章
  • Linux启动 Sendmail速度慢的解决办法
  • Linux系统下防垃圾邮件基本功能
  • Linux启动sendmail速度慢的解决办法
  • Domino V8 在 UNIX/Linux 平台上的安装及其常见问题
  • IBM Lotus Domino,Linux,虚拟化,可伸缩性:不再是相互排斥的术语
  • 19.11 参 考 资 料
  • 19.10 课 后 练 习
  • 19.9 重 点 回 顾
  • 19.8.3 quota与目录转移
  • 19.8.2 关于备份
  • 19.8.1 问题检查
  • 19.7.8 其他设置技巧
  • linux的基本操作(上)
  • Linux系统下应用知识大荟萃
  • GNU GRUB启动管理器
  • 制作基于软盘的Linux系统
  • 网络配置文件快速解读
  • linux的基本操作(下)
  • 剖析Linux系统启动过程
  • DameWare让局域网管理不再繁琐
  • 在Redhat 9下实现双机热备和集群功能
  • LINUX守护进程介绍
  • Redhat advance server 2.1集群的安装与管理
  • Linux必须学会的60个命令-文件处理
  • 自由广告区
     
    最新软件下载
  • SharePoint Server 2010 部署文档
  • Exchange 2010 RTM升级至SP1 教程
  • Exchange 2010 OWA下RBAC实现的组功能...
  • Lync Server 2010 Standard Edition 标..
  • Lync Server 2010 Enterprise Edition...
  • Forefront Endpoint Protection 2010 ...
  • Lync Server 2010 Edge 服务器部署文档
  • 《Exchange 2003专家指南》
  • Mastering Hyper-V Deployment
  • Windows Server 2008 R2 Hyper-V
  • Microsoft Lync Server 2010 Unleashed
  • Windows Server 2008 R2 Unleashed
  • 今日邮件技术文章
  • 腾讯,在创新中演绎互联网“进化论”
  • 华科人 张小龙 (中国第二代程序员 QQ...
  • 微软推出新功能 提高Hotmail密码安全性
  • 快压技巧分享:秒传邮件超大附件
  • 不容忽视的邮件营销数据分析过程中的算..
  • 国内手机邮箱的现状与未来发展——访尚..
  • 易观数据:2011Q2中国手机邮箱市场收入..
  • 穿越时空的爱恋 QQ邮箱音视频及贺卡邮件
  • Hotmail新功能:“我的朋友可能被黑了”
  • 入侵邻居网络发骚扰邮件 美国男子被重..
  • 网易邮箱莫子睿:《非你莫属》招聘多过..
  • 中国电信推广189邮箱绿色账单
  • 最新专题
  • 鸟哥的Linux私房菜之Mail服务器
  • Exchange Server 2010技术专题
  • Windows 7 技术专题
  • Sendmail 邮件系统配置
  • 组建Exchange 2003邮件系统
  • Windows Server 2008 专题
  • ORF 反垃圾邮件系统
  • Exchange Server 2007 专题
  • ISA Server 2006 教程专题
  • Windows Vista 技术专题
  • “黑莓”(BlackBerry)专题
  • Apache James 专题
  • 分类导航
    邮件新闻资讯:
    IT业界 | 邮件服务器 | 邮件趣闻 | 移动电邮
    电子邮箱 | 反垃圾邮件|邮件客户端|网络安全
    行业数据 | 邮件人物 | 网站公告 | 行业法规
    网络技术:
    邮件原理 | 网络协议 | 网络管理 | 传输介质
    线路接入 | 路由接口 | 邮件存储 | 华为3Com
    CISCO技术 | 网络与服务器硬件
    操作系统:
    Windows 9X | Linux&Uinx | Windows NT
    Windows Vista | FreeBSD | 其它操作系统
    邮件服务器:
    程序与开发 | Exchange | Qmail | Postfix
    Sendmail | MDaemon | Domino | Foxmail
    KerioMail | JavaMail | Winwebmail |James
    Merak&VisNetic | CMailServer | WinMail
    金笛邮件系统 | 其它 |
    反垃圾邮件:
    综述| 客户端反垃圾邮件|服务器端反垃圾邮件
    邮件客户端软件:
    Outlook | Foxmail | DreamMail| KooMail
    The bat | 雷鸟 | Eudora |Becky! |Pegasus
    IncrediMail |其它
    电子邮箱: 个人邮箱 | 企业邮箱 |Gmail
    移动电子邮件:服务器 | 客户端 | 技术前沿
    邮件网络安全:
    软件漏洞 | 安全知识 | 病毒公告 |防火墙
    攻防技术 | 病毒查杀| ISA | 数字签名
    邮件营销:
    Email营销 | 网络营销 | 营销技巧 |营销案例
    邮件人才:招聘 | 职场 | 培训 | 指南 | 职场
    解决方案:
    邮件系统|反垃圾邮件 |安全 |移动电邮 |招标
    产品评测:
    邮件系统 |反垃圾邮件 |邮箱 |安全 |客户端
    广告联系 | 合作联系 | 关于我们 | 联系我们 | 繁體中文
    版权所有:邮件技术资讯网©2003-2010 www.5dmail.net, All Rights Reserved
    www.5Dmail.net Web Team   粤ICP备05009143号