solaris添加硬盘的配置及format
在solaris的日常维护中,系统管理员可能要经常给工作站添加新的硬盘,或者更改原来的硬盘的分区,下面把添加新硬盘的过程简单的总结一下,希望可以和大家共同学习,有错误的地方,欢迎指正!(以ultra80工作站为例)
1、第一步,用format命令,看看系统是不是已经识别了该硬盘,如果识别了,可以继续;如果没有识别,键入init 0进入ok状态!用probe-scsi-all命令查看所识别的scsi设备,然后键入boot -r命令,重新启动;
2、第二步,format
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@1f,4000/scsi@3/sd@0,0
1. c0t1d0
/pci@1f,4000/scsi@3/sd@1,0
Specify disk (enter its number):
1号盘就是我新添加的硬盘,在Specify disk (enter its number):后面键入1,表示要对1号盘进行操作。
selecting c0t1d0
[disk formatted]
Warning: Current Disk has mounted partitions.
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
repair - repair a defective sector
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
inquiry - show vendor, product and revision
volname - set 8-character volume name
! - execute , then return
quit
在format〉提示符下键入p
format> p
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>提示符下输入m,进行分区
partition> m
Select partitioning base:
0. Current partition table (d)
1. All Free Hog
Choose base (enter number) [0]?
选择1,重新进行分区
Free Hog partition[6]? 7 ###这句的意思是说,分区剩余空间放在哪里,默认是6;
我们这里,把这块盘的所有空间都分配给7;
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '1' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '3' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '4' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '5' [0b, 0c, 0.00mb, 0.00gb]:
Enter size of partition '6' [0b, 0c, 0.00mb, 0.00gb]:
Part Tag Flag Cylinders Size Blocks
0 root wm 0 0 (0/0/0) 0
1 swap wu 0 0 (0/0/0) 0
2 backup wu 0 - 24619 33.92GB (24620/0/0) 71127180
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 usr wm 0 0 (0/0/0) 0
7 unassigned wm 0 - 24619 33.92GB (24620/0/0) 71127180
可以看出,分区7和硬盘的总大小(2)相等
下面是给该分区设置table为disk1_7
Okay to make this the current partition table[yes]? disk1_7
至此格式化完毕!
3、给格式化完的分区创建文件系统,命令如下
newfs /dev/rdsk/c0t1d0s7
下面是创建文件系统的过程
newfs: construct a new file system /dev/rdsk/c0t1d0s7: (y/n)? y
Cylinder groups must have a multiple of 16 cylinders with the given par
Rounded cgsize up to 256
/dev/rdsk/c0t1d0s7: 71127180 sectors in 24620 cylinders of 27 track
ctors
34730.1MB in 770 cyl groups (32 c/g, 45.14MB/g, 5632 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 92592, 185152, 277712, 370272, 462832, 555392, 647952, 740512, 833
925632, 1018192, 1110752, 1203312, 1295872, 1388432, 1480992, 1573552,
1666112, 1758672, 1851232, 1943792, 2036352, 2128912, 2221472, 2314032
2406592, 2499152, 2591712, 2684272, 2776832, 2869392, 2958368, 3050928
3143488, 3236048, 3328608, 3421168, 3513728, 3606288, 3698848, 3791408
3883968, 3976528, 4069088, 4161648, 4254208, 4346768, 4439328, 4531888
4624448, 4717008, 4809568, 4902128, 4994688, 5087248, 5179808, 5272368
5364928, 5457488, 5550048, 5642608, 5735168, 5827728, 5916704, 6009264
6101824, 6194384, 6286944, 6379504, 6472064, 6564624, 6657184, 6749744
6842304, 6934864, 7027424, 7119984, 7212544, 7305104, 7397664, 7490224
7582784, 7675344, 7767904, 7860464, 7953024, 8045584, 8138144, 8230704
8323264, 8415824, 8508384, 8600944, 8693504, 8786064, 8875040, 8967600
9060160, 9152720, 9245280, 9337840, 9430400, 9522960, 9615520, 9708080
9800640, 9893200, 9985760, 10078320, 10170880, 10263440, 10356000, 104
10541120, 10633680, 10726240, 10818800, 10911360, 11003920, 11096480,
11189040, 11281600, 11374160, 11466720, 11559280, 11651840, 11744400,
11833376, 11925936, 12018496, 12111056, 12203616, 12296176, 12388736,
12481296, 12573856, 12666416, 12758976, 12851536, 12944096, 13036656,
13129216, 13221776, 13314336, 13406896, 13499456, 13592016, 13684576,
13777136, 13869696, 13962256, 14054816, 14147376, 14239936, 14332496,
14425056, 14517616, 14610176, 14702736, 14791712, 14884272, 14976832,
15069392, 15161952, 15254512, 15347072, 15439632, 15532192, 15624752,
15717312, 15809872, 15902432, 15994992, 16087552, 16180112, 16272672,
16365232, 16457792, 16550352, 16642912, 16735472, 16828032, 16920592,
17013152, 17105712, 17198272, 17290832, 17383392, 17475952, 17568512,
17661072, 17750048, 17842608, 17935168, 18027728, 18120288, 18212848,
18305408, 18397968, 18490528, 18583088, 18675648, 18768208, 18860768,
18953328, 19045888, 19138448, 19231008, 19323568, 19416128, 19508688,
19601248, 19693808, 19786368, 19878928, 19971488, 20064048, 20156608,
20249168, 20341728, 20434288, 20526848, 20619408, 20708384, 20800944,
20893504, 20986064, 21078624, 21171184, 21263744, 21356304, 21448864,
21541424, 21633984, 21726544, 21819104, 21911664, 22004224, 22096784,
22189344, 22281904, 22374464, 22467024, 22559584, 22652144, 22744704,
22837264, 22929824, 23022384, 23114944, 23207504, 23300064, 23392624,
23485184, 23577744, 23666720, 23759280, 23851840, 23944400, 24036960,
24129520, 24222080, 24314640, 24407200, 24499760, 24592320, 24684880,
24777440, 24870000, 24962560, 25055120, 25147680, 25240240, 25332800,
25425360, 25517920, 25610480, 25703040, 25795600, 25888160, 25980720,
26073280, 26165840, 26258400, 26350960, 26443520, 26536080, 26625056,
26717616, 26810176, 26902736, 26995296, 27087856, 27180416, 27272976,
27365536, 27458096, 27550656, 27643216, 27735776, 27828336, 27920896,
28013456, 28106016, 28198576, 28291136, 28383696, 28476256, 28568816,
28661376, 28753936, 28846496, 28939056, 29031616, 29124176, 29216736,
29309296, 29401856, 29494416, 29583392, 29675952, 29768512, 29861072,
29953632, 30046192, 30138752, 30231312, 30323872, 30416432, 30508992,
30601552, 30694112, 30786672, 30879232, 30971792, 31064352, 31156912,
31249472, 31342032, 31434592, 31527152, 31619712, 31712272, 31804832,
31897392, 31989952, 32082512, 32175072, 32267632, 32360192, 32452752,
32541728, 32634288, 32726848, 32819408, 32911968, 33004528, 33097088,
33189648, 33282208, 33374768, 33467328, 33559888, 33652448, 33745008,
33837568, 33930128, 34022688, 34115248, 34207808, 34300368, 34392928,
34485488, 34578048, 34670608, 34763168, 34855728, 34948288, 35040848,
35133408, 35225968, 35318528, 35411088, 35500064, 35592624, 35685184,
35777744, 35870304, 35962864, 36055424, 36147984, 36240544, 36333104,
36425664, 36518224, 36610784, 36703344, 36795904, 36888464, 36981024,
37073584, 37166144, 37258704, 37351264, 37443824, 37536384, 37628944,
37721504, 37814064, 37906624, 37999184, 38091744, 38184304, 38276864,
38369424, 38458400, 38550960, 38643520, 38736080, 38828640, 38921200,
39013760, 39106320, 39198880, 39291440, 39384000, 39476560, 39569120,
39661680, 39754240, 39846800, 39939360, 40031920, 40124480, 40217040,
40309600, 40402160, 40494720, 40587280, 40679840, 40772400, 40864960,
40957520, 41050080, 41142640, 41235200, 41327760, 41416736, 41509296,
41601856, 41694416, 41786976, 41879536, 41972096, 42064656, 42157216,
42249776, 42342336, 42434896, 42527456, 42620016, 42712576, 42805136,
42897696, 42990256, 43082816, 43175376, 43267936, 43360496, 43453056,
43545616, 43638176, 43730736, 43823296, 43915856, 44008416, 44100976,
44193536, 44286096, 44375072, 44467632, 44560192, 44652752, 44745312,
44837872, 44930432, 45022992, 45115552, 45208112, 45300672, 45393232,
45485792, 45578352, 45670912, 45763472, 45856032, 45948592, 46041152,
46133712, 46226272, 46318832, 46411392, 46503952, 46596512, 46689072,
46781632, 46874192, 46966752, 47059312, 47151872, 47244432, 47333408,
47425968, 47518528, 47611088, 47703648, 47796208, 47888768, 47981328,
48073888, 48166448, 48259008, 48351568, 48444128, 48536688, 48629248,
48721808, 48814368, 48906928, 48999488, 49092048, 49184608, 49277168,
49369728, 49462288, 49554848, 49647408, 49739968, 49832528, 49925088,
50017648, 50110208, 50202768, 50291744, 50384304, 50476864, 50569424,
50661984, 50754544, 50847104, 50939664, 51032224, 51124784, 51217344,
51309904, 51402464, 51495024, 51587584, 51680144, 51772704, 51865264,
51957824, 52050384, 52142944, 52235504, 52328064, 52420624, 52513184,
52605744, 52698304, 52790864, 52883424, 52975984, 53068544, 53161104,
53250080, 53342640, 53435200, 53527760, 53620320, 53712880, 53805440,
53898000, 53990560, 54083120, 54175680, 54268240, 54360800, 54453360,
54545920, 54638480, 54731040, 54823600, 54916160, 55008720, 55101280,
55193840, 55286400, 55378960, 55471520, 55564080, 55656640, 55749200,
55841760, 55934320, 56026880, 56119440, 56208416, 56300976, 56393536,
56486096, 56578656, 56671216, 56763776, 56856336, 56948896, 57041456,
57134016, 57226576, 57319136, 57411696, 57504256, 57596816, 57689376,
57781936, 57874496, 57967056, 58059616, 58152176, 58244736, 58337296,
58429856, 58522416, 58614976, 58707536, 58800096, 58892656, 58985216,
59077776, 59166752, 59259312, 59351872, 59444432, 59536992, 59629552,
59722112, 59814672, 59907232, 59999792, 60092352, 60184912, 60277472,
60370032, 60462592, 60555152, 60647712, 60740272, 60832832, 60925392,
61017952, 61110512, 61203072, 61295632, 61388192, 61480752, 61573312,
61665872, 61758432, 61850992, 61943552, 62036112, 62125088, 62217648,
62310208, 62402768, 62495328, 62587888, 62680448, 62773008, 62865568,
62958128, 63050688, 63143248, 63235808, 63328368, 63420928, 63513488,
63606048, 63698608, 63791168, 63883728, 63976288, 64068848, 64161408,
64253968, 64346528, 64439088, 64531648, 64624208, 64716768, 64809328,
64901888, 64994448, 65083424, 65175984, 65268544, 65361104, 65453664,
65546224, 65638784, 65731344, 65823904, 65916464, 66009024, 66101584,
66194144, 66286704, 66379264, 66471824, 66564384, 66656944, 66749504,
66842064, 66934624, 67027184, 67119744, 67212304, 67304864, 67397424,
67489984, 67582544, 67675104, 67767664, 67860224, 67952784, 68041760,
68134320, 68226880, 68319440, 68412000, 68504560, 68597120, 68689680,
68782240, 68874800, 68967360, 69059920, 69152480, 69245040, 69337600,
69430160, 69522720, 69615280, 69707840, 69800400, 69892960, 69985520,
70078080, 70170640, 70263200, 70355760, 70448320, 70540880, 70633440,
70726000, 70818560, 70911120, 71000096, 71092656,
4、创建mount点,命令如下
mount /dev/dsk/c0t1d0s7 /disk1_7
至此,新增添的硬盘就可以使用了
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13053/showart_146589.html