添加硬盘的步骤

原创 2004年07月03日 19:33:00

刚开始学习Solaris,错漏之处,望指教

基本步骤:
1)关闭机器,接上硬盘
2)devfsadm
3)format记下认识出来的cXdX
4)format->fdisk->partition生成需要的分区(记得保存)
5)newfs 记得此时设备名称中的s要与上面生成的partition对应
6)建立必要的目录然后挂上?
===========================================================================================================
下面是第一块磁盘的信息:

bash-2.05# prtvtoc /dev/rdsk/c0d0s0
* /dev/rdsk/c0d0s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*      15 tracks/cylinder
*     945 sectors/cylinder
*   24388 cylinders
*   24386 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
* Unallocated space:
*       First     Sector    Last
*       Sector     Count    Sector
*    23043825       945  23044769
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00       2835   1434510   1437344   /
       1      7    00    1437345   1229445   2666789   /var
       3      3    01    2666790   1206765   3873554
       5      0    00    3873555  14049315  17922869   /opt
       6      4    00   17922870   4096575  22019444   /usr
       7      8    00   22019445   1024380  23043824   /export/home
       8      1    01          0       945       944
       9      9    01        945      1890      2834

partition> print
Current partition table (original):
Total disk cylinders available: 24386 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0       root    wm       3 -  1520      700.44MB    (1518/0/0)   1434510
  1        var    wm    1521 -  2821      600.31MB    (1301/0/0)   1229445
  2     backup    wm       0                0         (0/0/0)            0
  3       swap    wu    2822 -  4098      589.24MB    (1277/0/0)   1206765
  4 unassigned    wm       0                0         (0/0/0)            0
  5 unassigned    wm    4099 - 18965        6.70GB    (14867/0/0) 14049315
  6        usr    wm   18966 - 23300        1.95GB    (4335/0/0)   4096575
  7       home    wm   23301 - 24384      500.19MB    (1084/0/0)   1024380
  8       boot    wu       0 -     0        0.46MB    (1/0/0)          945
  9 alternates    wu       1 -     2        0.92MB    (2/0/0)         1890

下面增加第二个硬盘:
SunOS 5.9

login: root
Password:
Last login: Sat Jul  3 17:23:22 from :0
Sun Microsystems Inc.   SunOS 5.9       Generic January 2003
# bash
bash-2.05# devfsadm
bash-2.05# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0d0
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
Specify disk (enter its number): 1
selecting c0d1
Controller working list found
[disk formatted, defect list found]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        show       - translate a disk address
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> partition
Please run fdisk first.
format> fdisk
No fdisk table exists. The default partition for the disk is:

  a 100% "SOLARIS System" partition

Type "y" to accept the default partition, otherwise type "n" to edit the
partition table.
y
format> partition


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        ! - execute , then return
        quit
partition> print
Current partition table (original):
Total disk cylinders available: 8319 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)          0
  1 unassigned    wm       0               0         (0/0/0)          0
  2     backup    wu       0 - 8319        4.00GB    (8320/0/0) 8386560
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6 unassigned    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
  8       boot    wu       0 -    0        0.49MB    (1/0/0)       1008
  9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016

partition> 0
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)          0

Enter partition id tag[unassigned]: root
Enter partition permission flags[wm]: wm
Enter new starting cyl[3]:
Enter partition size[0b, 0c, 3e, 0.00mb, 0.00gb]: 400mb
partition> print
Current partition table (unnamed):
Total disk cylinders available: 8319 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       3 -  815      400.15MB    (813/0/0)   819504
  1 unassigned    wm       0               0         (0/0/0)          0
  2     backup    wu       0 - 8319        4.00GB    (8320/0/0) 8386560
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6 unassigned    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
  8       boot    wu       0 -    0        0.49MB    (1/0/0)       1008
  9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016

partition> 1
Part      Tag    Flag     Cylinders        Size            Blocks
  1 unassigned    wm       0               0         (0/0/0)          0

Enter partition id tag[unassigned]: swap
Enter partition permission flags[wm]: wu
Enter new starting cyl[3]: 816
Enter partition size[0b, 0c, 816e, 0.00mb, 0.00gb]: 100mb
partition> print
Current partition table (unnamed):
Total disk cylinders available: 8319 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       3 -  815      400.15MB    (813/0/0)   819504
  1       swap    wu     816 - 1019      100.41MB    (204/0/0)   205632
  2     backup    wu       0 - 8319        4.00GB    (8320/0/0) 8386560
  3 unassigned    wm       0               0         (0/0/0)          0
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6 unassigned    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
  8       boot    wu       0 -    0        0.49MB    (1/0/0)       1008
  9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016

partition> 3
Part      Tag    Flag     Cylinders        Size            Blocks
  3 unassigned    wm       0               0         (0/0/0)          0

Enter partition id tag[unassigned]: ?
Expecting one of the following: (abbreviations ok):
        unassigned    boot          root          swap
        usr           backup        stand         var
        home          alternates    reserved

Enter partition id tag[unassigned]: home
Enter partition permission flags[wm]:
Enter new starting cyl[3]: 1020
Enter partition size[0b, 0c, 1020e, 0.00mb, 0.00gb]: $
partition> print
Current partition table (unnamed):
Total disk cylinders available: 8319 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       3 -  815      400.15MB    (813/0/0)   819504
  1       swap    wu     816 - 1019      100.41MB    (204/0/0)   205632
  2     backup    wu       0 - 8319        4.00GB    (8320/0/0) 8386560
  3       home    wm    1020 - 8318        3.51GB    (7299/0/0) 7357392
  4 unassigned    wm       0               0         (0/0/0)          0
  5 unassigned    wm       0               0         (0/0/0)          0
  6 unassigned    wm       0               0         (0/0/0)          0
  7 unassigned    wm       0               0         (0/0/0)          0
  8       boot    wu       0 -    0        0.49MB    (1/0/0)       1008
  9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016

partition> label
Ready to label disk, continue? y

partition> name
Enter table name (remember quotes): diskmy

partition> quit


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        show       - translate a disk address
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> save
Saving new disk and partition definitions
Enter file name["./format.dat"]:
format> save
Saving new disk and partition definitions
Enter file name["./format.dat"]: /etc/format.dat
format> quit
bash-2.05# prtvtoc /dev/rdsk/c0d1s0
* /dev/rdsk/c0d1s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*      16 tracks/cylinder
*    1008 sectors/cylinder
*    8321 cylinders
*    8319 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00       3024    819504    822527
       1      3    01     822528    205632   1028159
       2      5    01          0   8385552   8385551
       3      8    00    1028160   7357392   8385551
       8      1    01          0      1008      1007
       9      9    00       1008      2016      3023
bash-2.05# newfs /dev/rdsk/c0d1s0
newfs: construct a new file system /dev/rdsk/c0d1s0: (y/n)? y
/dev/rdsk/c0d1s0:       819504 sectors in 813 cylinders of 16 tracks, 63 sectors
        400.1MB in 51 cyl groups (16 c/g, 7.88MB/g, 3776 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 16224, 32416, 48608, 64800, 80992, 97184, 113376, 129568, 145760,
 661856, 678048, 694240, 710432, 726624, 742816, 759008, 774176, 790368,
 806560,
bash-2.05# newfs /dev/rdsk/c0d1s1
newfs: construct a new file system /dev/rdsk/c0d1s1: (y/n)? y
/dev/rdsk/c0d1s1:       205632 sectors in 204 cylinders of 16 tracks, 63 sectors
        100.4MB in 13 cyl groups (16 c/g, 7.88MB/g, 3776 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 16224, 32416, 48608, 64800, 80992, 97184, 113376, 129568, 145760,
 161952, 178144, 194336,
bash-2.05# newfs /dev/rdsk/c0d1s3
newfs: construct a new file system /dev/rdsk/c0d1s3: (y/n)? y
/dev/rdsk/c0d1s3:       7357392 sectors in 7299 cylinders of 16 tracks, 63 sectors
        3592.5MB in 83 cyl groups (88 c/g, 43.31MB/g, 5504 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
 32, 88800, 177568, 266336, 355104, 443872, 532640, 621408, 710176, 798944,
 6476000, 6564768, 6653536, 6742304, 6831072, 6919840, 7008608, 7096352,
 7185120, 7273888,
bash-2.05# mount /dev/dsk/c0d1s0 /disk2root
bash-2.05# mount /dev/dsk/c0d1s1 /disk2swap
bash-2.05# mount /dev/dsk/c0d1s3 /disk2home
bash-2.05# fstyp -v /dev/rdsk/c0d1s0 | head -10
ufs
magic   11954   format  dynamic time    Sat Jul  3 17:34:08 2004
sblkno  16      cblkno  24      iblkno  32      dblkno  504
sbsize  2048    cgsize  2048    cgoffset 32     cgmask  0xfffffff0
ncg     51      size    409752  blocks  384847
bsize   8192    shift   13      mask    0xffffe000
fsize   1024    shift   10      mask    0xfffffc00
frag    8       shift   3       fsbtodb 1
minfree 10%     maxbpg  2048    optim   time
maxcontig 7     rotdelay 0ms    rps     60
Broken Pipe
Unknown_fstyp (no matches)
bash-2.05# prtvtoc /dev/rdsk/c0d1s0
* /dev/rdsk/c0d1s0 partition map
*
* Dimensions:
*     512 bytes/sector
*      63 sectors/track
*      16 tracks/cylinder
*    1008 sectors/cylinder
*    8321 cylinders
*    8319 accessible cylinders
*
* Flags:
*   1: unmountable
*  10: read-only
*
*                          First     Sector    Last
* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory
       0      2    00       3024    819504    822527   /disk2root
       1      3    01     822528    205632   1028159   /disk2swap
       2      5    01          0   8385552   8385551
       3      8    00    1028160   7357392   8385551   /disk2home
       8      1    01          0      1008      1007
       9      9    00       1008      2016      3023
bash-2.05# df -h
Filesystem             size   used  avail capacity  Mounted on
/dev/dsk/c0d0s0        657M    65M   533M    11%    /
/dev/dsk/c0d0s6        1.9G   1.3G   530M    72%    /usr
/dev/dsk/c0d0p0:boot    10M   1.5M   8.5M    16%    /boot
/proc                    0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
fd                       0K     0K     0K     0%    /dev/fd
/dev/dsk/c0d0s1        563M    65M   442M    13%    /var
swap                   759M    24K   759M     1%    /var/run
swap                   759M     4K   759M     1%    /tmp
/dev/dsk/c0d0s5        6.6G   613M   5.9G    10%    /opt
/dev/dsk/c0d0s7        469M     9K   422M     1%    /export/home
/dev/dsk/c0d1s0        376M     9K   338M     1%    /disk2root
/dev/dsk/c0d1s1         94M     9K    85M     1%    /disk2swap
/dev/dsk/c0d1s3        3.5G     9K   3.4G     1%    /disk2home
bash-2.05# mount
/ on /dev/dsk/c0d0s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980000 on Sat Jul  3 17:22:39 2004
/usr on /dev/dsk/c0d0s6 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980006 on Sat Jul  3 17:22:40 2004
/boot on /dev/dsk/c0d0p0:boot read/write/setuid/nohidden/nofoldcase/dev=19a3010 on Sat Jul  3 17:22:37 2004
/proc on /proc read/write/setuid/dev=2e80000 on Sat Jul  3 17:22:39 2004
/etc/mnttab on mnttab read/write/setuid/dev=2f40000 on Sat Jul  3 17:22:39 2004
/dev/fd on fd read/write/setuid/dev=2f80000 on Sat Jul  3 17:22:40 2004
/var on /dev/dsk/c0d0s1 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980001 on Sat Jul  3 17:22:42 2004
/var/run on swap read/write/setuid/xattr/dev=1 on Sat Jul  3 17:22:42 2004
/tmp on swap read/write/setuid/xattr/dev=2 on Sat Jul  3 17:22:44 2004
/opt on /dev/dsk/c0d0s5 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980005 on Sat Jul  3 17:22:44 2004
/export/home on /dev/dsk/c0d0s7 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980007 on Sat Jul  3 17:22:44 2004
/disk2root on /dev/dsk/c0d1s0 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980040 on Sat Jul  3 17:33:35 2004
/disk2swap on /dev/dsk/c0d1s1 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980041 on Sat Jul  3 17:33:45 2004
/disk2home on /dev/dsk/c0d1s3 read/write/setuid/intr/largefiles/xattr/onerror=panic/dev=1980043 on Sat Jul  3 17:33:52 2004
bash-2.05#

将下面的内容添加到/etc/vfstab中即可实现自动挂载
/dev/dsk/c0d1s0 /dev/rdsk/c0d1s0        /disk2root      ufs     1       yes     logging
对其它对应的分区挂载即可

linux添加新硬盘步骤

linux添加新硬盘步骤 使用Root用户运行命令: 一:分区 fdisk /dev/hdb 备注:hda为第一块盘 hdb为第二快盘 输入n增加分区  输入p类型设置为:主分区  输入1分区编号设置...
  • esonbest1234
  • esonbest1234
  • 2016年02月24日 11:31
  • 181

linux服务器挂载新磁盘步骤

使用Root用户运行命令:  fdisk /dev/sdb  (注意如果你用的是Centos6.0以下版本 设备名可能是/dev/hda 因此  命令应该是fdisk /dev/hda)  ...
  • y072154750
  • y072154750
  • 2016年09月14日 15:36
  • 133

Linux下添加新硬盘的步骤

  在服务器上把硬盘接好,启动linux,以root登陆。比如我新加一块SCSI硬盘,需要将其分成三个区:代码:#fdisk /dev/sdb进入fdis...
  • yuanfen127
  • yuanfen127
  • 2008年03月24日 15:18
  • 877

ubuntu添加新硬盘

启动Ubuntu,root用户登录。     在终端输入:fdisk -l ,可以看到     --------------------------------------------------...
  • haichunzhao
  • haichunzhao
  • 2014年04月29日 14:38
  • 1999

一次IBM 服务器的磁盘故障更换过程

服务器是IBM的X3650 ,5块硬盘RAID 5,1块Hot Spare (但是估计当时装机的人没有配置成hot spare,后面再看详细内容) 故障时的磁盘状态: [root@serv1 ...
  • db_bili
  • db_bili
  • 2011年11月30日 12:16
  • 2709

[PartitionMagic]对电脑硬盘/移动硬盘分区等操作

内容参考自:http://www.tech-ex.com/learning/swdiy/00445123.html 参考图解教程:http://www.xdowns.com/article/170/a...
  • suxiang198
  • suxiang198
  • 2015年07月11日 00:15
  • 628

Ubuntu中添加新硬盘

为系统扩充磁盘存储容量是一件非常常见的事情,特别是现在在云平台中。不像windows系统,当我们在系统中添加一块硬盘时,系统有界面提示有新硬件,你可以直接在新硬件上右键,然后格式化之后就能用了。但在L...
  • scaleqiao
  • scaleqiao
  • 2015年04月16日 10:16
  • 7202

[Ubuntu] 服务器添加硬盘方法

查看当前硬盘状况 添加分区 分区格式化 挂载分区到用户目录 执行服务器开机自动挂载 服务器容量 10 T 竟然只剩 50G 不到了。 公司加了 500 G 的普通硬盘用于存放不常用的源码。 以下是...
  • dearsq
  • dearsq
  • 2016年11月01日 16:01
  • 492

关于如何在Ubuntu中添加新硬盘

今天老师拿了两块硬盘过来,要插入服务器中,我好像以前做过,但现在不记得了。 查了一下资料,自己动手实践一下,花费了不少时间,现在做一个记录: 首先参照这个的过程,因为是Ubuntu有界面的话,就没...
  • huyongfeijoe
  • huyongfeijoe
  • 2016年05月18日 21:41
  • 737

为Ubuntu添加一块新硬盘步骤

1. 使用Gparted为新硬盘进行分区操作 注:分区表选择默认值:msdos即可 2. 为新硬盘添加自启动的mount命令 1). 找到分区UUID 2). 在/et...
  • Robinsone
  • Robinsone
  • 2015年05月14日 13:51
  • 1195
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:添加硬盘的步骤
举报原因:
原因补充:

(最多只允许输入30个字)