ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Howto add an disk to Solaris 10

Howto add an disk to Solaris 10

原创 Linux操作系统 作者:jolly10 时间:2009-08-19 15:05:30 0 删除 编辑

An common task is to connect another SATA disk to the system. When you're used on running Linux, you will find it logic that Linux just sees the disk, and you can fdisk it right away. Solaris is just another story.

[@more@]

To let solaris know a new disk is added I run the cmd :

devfsadm -vC

It scans the system and will add and remove new and old devices. When the cmd completes, time for another cmd :

format

This cmd let you choose a disk to format, and create an Solaris label on the disk. After creating the label, have fun by slicing the disk. (It's a killer :-) Preparing an disk is done like :

# format

Searching for disks...done


AVAILABLE DISK SELECTIONS:

0. c2d0

/pci@0,0/pci-ide@8/ide@1/cmdk@0,0

1. c3d0

/pci@0,0/pci-ide@7/ide@0/cmdk@0,0

Specify disk (enter its number): 1

selecting c3d0

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> 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> lABEL

`lABEL' is not expected.

format> label

Ready to label disk, continue? y

format> verify

Warning: Primary label on disk appears to be different from

current label.

Warning: Check the current partitioning and 'label' the disk or use the

'backup' command.

Primary label contents:

Volume name = < >

ascii name =

pcyl = 30400

ncyl = 30398

acyl = 2

bcyl = 0

nhead = 255

nsect = 63

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 - 30397 232.86GB (30398/0/0) 488343870

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 7.84MB (1/0/0) 16065

9 alternates wm 1 - 2 15.69MB (2/0/0) 32130

format> par

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> mod

Select partitioning base:

0. Current partition table (original)

1. All Free Hog

Choose base (enter number) [0]? 1

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 - 30397 232.86GB (30398/0/0) 488343870

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 0 (0/0/0) 0

8 boot wu 0 - 0 7.84MB (1/0/0) 16065

9 alternates wm 1 - 2 15.69MB (2/0/0) 32130

Do you wish to continue creating a new partition

table based on above table[yes]?

Free Hog partition[6]?

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 '7' [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 - 30397 232.86GB (30398/0/0) 488343870

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 3 - 30397 232.84GB (30395/0/0) 488295675

7 unassigned wm 0 0 (0/0/0) 0

8 boot wu 0 - 0 7.84MB (1/0/0) 16065

9 alternates wm 1 - 2 15.69MB (2/0/0) 32130

Okay to make this the current partition table[yes]?

Enter table name (remember quotes): "datadsk"

Ready to label disk, continue? y

partition> q

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> verify

Warning: Primary label on disk appears to be different from

current label.

Warning: Check the current partitioning and 'label' the disk or use the

'backup' command.

Primary label contents:

Volume name = < >

ascii name =

pcyl = 30400

ncyl = 30398

acyl = 2

bcyl = 0

nhead = 255

nsect = 63

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 - 30397 232.86GB (30398/0/0) 488343870

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 3 - 30397 232.84GB (30395/0/0) 488295675

7 unassigned wm 0 0 (0/0/0) 0

8 boot wu 0 - 0 7.84MB (1/0/0) 16065

9 alternates wm 1 - 2 15.69MB (2/0/0) 32130

format> q

Two more steps to go, first a filesystem is needed, and after that the disk must be mounted. Creating an filesystem is easy :

# newfs /dev/dsk/c3d0s6
newfs: construct a new file system /dev/rdsk/c3d0s6: (y/n)? y
Warning: 4870 sector(s) in last cylinder unallocated
/dev/rdsk/c3d0s6: 488295674 sectors in 79476 cylinders of 48 tracks, 128 sectors
238425.6MB in 4968 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
...............................................................................
....................
super-block backups for last 10 cylinder groups at:
487395104, 487493536, 487591968, 487690400, 487788832, 487887264, 487985696,
488084128, 488182560, 488280992

And mounting the disk :

# mount /dev/dsk/c3d0s6 /mnt

# df -h /mnt/
Filesystem size used avail capacity Mounted on
/dev/dsk/c3d0s6 229G 64M 227G 1% /mnt

Well that whas easy, wasn't it ?

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271283/viewspace-1026166/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-02-20

  • 博文量
    263
  • 访问量
    828526