One of our customers decided to add 2 more disks to his Adaptec 5085 SATA RAID controller and asked me to create RAID1 array. Of course not at the time when I could easily do it from the controller BIOS so I had to resort to Adaptec arcconf command line tool.
The documentation claims that pretty much all controller maintenance could be done using arcconf. And I do really believe it. There is one small problem though – the provided documentation is very unfirendly and in context of our task – inaccurate as well.
Lets begin.
- Find out current controller state, physical drives in particular – we would like to know what are the spare drives not configured for any array
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141[root@linux ~]# ./arcconf getconfig 1 pdControllers found: 1----------------------------------------------------------------------Physical Device information----------------------------------------------------------------------Device #0Device is a Hard driveState : OnlineSupported : YesTransfer Speed : SATA 3.0 Gb/sReported Channel,Device(T:L) : 0,0(0:0)Reported Location : Enclosure 0, Slot 0Reported ESD(T:L) : 2,0(0:0)Vendor : WDCModel : WD2003FYYS-0Firmware : 01.01D01Serial number : WD-WMAY01893344Size : 1907729 MBWrite Cache : Enabled (write-back)FRU : NoneS.M.A.R.T. : NoS.M.A.R.T. warnings : 0Power State : Full rpmSupported Power States : Full rpm,Powered off,Reduced rpmSSD : NoMaxIQ Cache Capable : NoMaxIQ Cache Assigned : NoNCQ status : EnabledDevice #1Device is a Hard driveState : OnlineSupported : YesTransfer Speed : SATA 3.0 Gb/sReported Channel,Device(T:L) : 0,1(1:0)Reported Location : Enclosure 0, Slot 1Reported ESD(T:L) : 2,0(0:0)Vendor : WDCModel : WD2003FYYS-0Firmware : 01.01D01Serial number : WD-WMAY01625721Size : 1907729 MBWrite Cache : Enabled (write-back)FRU : NoneS.M.A.R.T. : NoS.M.A.R.T. warnings : 0Power State : Full rpmSupported Power States : Full rpm,Powered off,Reduced rpmSSD : NoMaxIQ Cache Capable : NoMaxIQ Cache Assigned : NoNCQ status : EnabledDevice #2Device is a Hard driveState : Hot SpareDedicated Spare for : logical device 0Supported : YesTransfer Speed : SATA 3.0 Gb/sReported Channel,Device(T:L) : 0,2(2:0)Reported Location : Enclosure 0, Slot 2Reported ESD(T:L) : 2,0(0:0)Vendor : WDCModel : WD2003FYYS-0Firmware : 01.01D01Serial number : WD-WMAY01785435Size : 1907729 MBWrite Cache : Enabled (write-back)FRU : NoneS.M.A.R.T. : NoS.M.A.R.T. warnings : 0Power State : Full rpmSupported Power States : Full rpm,Powered off,Reduced rpmSSD : NoMaxIQ Cache Capable : NoMaxIQ Cache Assigned : NoNCQ status : EnabledDevice #3Device is a Hard driveState : ReadySupported : YesTransfer Speed : SATA 3.0 Gb/sReported Channel,Device(T:L) : 0,3(3:0)Reported Location : Enclosure 0, Slot 3Reported ESD(T:L) : 2,0(0:0)Vendor : WDCModel : WD2003FYYS-0Firmware : 01.01D01Serial number : WD-WMAY02063263Size : 1907729 MBWrite Cache : Enabled (write-back)FRU : NoneS.M.A.R.T. : NoS.M.A.R.T. warnings : 0Power State : Full rpmSupported Power States : Full rpm,Powered off,Reduced rpmSSD : NoMaxIQ Cache Capable : NoMaxIQ Cache Assigned : NoNCQ status : EnabledDevice #4Device is a Hard driveState : ReadySupported : YesTransfer Speed : SATA 3.0 Gb/sReported Channel,Device(T:L) : 0,4(4:0)Reported Location : Enclosure 1, Slot 4Reported ESD(T:L) : 2,1(1:0)Vendor : WDCModel : WD2003FYYS-0Firmware : 01.01D01Serial number : WD-WMAY01157345Size : 1907729 MBWrite Cache : Enabled (write-back)FRU : NoneS.M.A.R.T. : NoS.M.A.R.T. warnings : 0Power State : Full rpmSupported Power States : Full rpm,Powered off,Reduced rpmSSD : NoMaxIQ Cache Capable : NoMaxIQ Cache Assigned : NoNCQ status : EnabledDevice #5Device is an Enclosure services deviceReported Channel,Device(T:L) : 2,0(0:0)Enclosure ID : 0Type : SES2Vendor : ADAPTECModel : Virtual SGPIOFirmware : 0001Status of Enclosure services deviceDevice #6Device is an Enclosure services deviceReported Channel,Device(T:L) : 2,1(1:0)Enclosure ID : 1Type : SES2Vendor : ADAPTECModel : Virtual SGPIOFirmware : 0001Status of Enclosure services deviceCommand completed successfully.
We have 5 disks: 0,1 – logical disk #0 RAID1, 2 – loagical disk #0 hot spare, 3,4 – unused disks for our new RAID1 array. - Lets create logical disk #1 out of physical disks 3 and 4.
123456789[root@linux ~]# ./arcconf create 1 logicaldrive max 1 0,3 0,4Controllers found: 1Do you want to add a logical device to the configuration?Press y, then ENTER to continue or press ENTER to abort: yCreating logical device: Device 1Command completed successfully.
In our command line: arcconf create 1 logicaldrive max 1 0,3 0,4:
create – controller command
1 – controller # ( if you have more than 1)
logicaldrive – target of create command
max – size of logical drive in megabytes (all of it in our case)
1 – RAID level (1 – mirror)
0,3 0,4 – channel, physical device id # ( comma is very important in this case – all instructions I saw so far didn’t have the comma and thus incorrect)
[noprompt] – I would’ve use that to avoid confirmation dialog but I forgot. It came out all right regardless. -
Now system should detect appearance of the new device
12345678910111213141516171819[root@linux ~]# dmeg |grep -v TCP | tail -100Vendor: Adaptec Model: Device 1 Rev: V1.0Type: Direct-Access ANSI SCSI revision: 02SCSI device sdb: 3900680192 512-byte hdwr sectors (1997148 MB)sdb: Write Protect is offsdb: Mode Sense: 06 00 10 00SCSI device sdb: drive cache: write through w/ FUASCSI device sdb: 3900680192 512-byte hdwr sectors (1997148 MB)sdb: Write Protect is offsdb: Mode Sense: 06 00 10 00SCSI device sdb: drive cache: write through w/ FUAsdb: unknown partition tablesd 0:0:1:0: Attached scsi removable disk sdbsd 0:0:1:0: Attached scsi generic sg8 type 0SCSI device sdb: 3900680192 512-byte hdwr sectors (1997148 MB)sdb: Write Protect is offsdb: Mode Sense: 06 00 10 00SCSI device sdb: drive cache: write through w/ FUAsdb: detected capacity change from 0 to 1997148258304 -
We will also want to check the new logical disk #1 appearance on the controller
123456789101112131415161718192021222324252627[root@linux ~]# ./arcconf getconfig 1 ld 1Controllers found: 1----------------------------------------------------------------------Logical device information----------------------------------------------------------------------Logical device number 1Logical device name : Device 1RAID level : 1Status of logical device : OptimalSize : 1904629 MBRead-cache mode : EnabledMaxIQ preferred cache setting : EnabledMaxIQ cache setting : DisabledWrite-cache mode : Enabled (write-back)Write-cache setting : Enabled (write-back)Partitioned : YesProtected by Hot-Spare : NoBootable : NoFailed stripes : NoPower settings : Disabled--------------------------------------------------------Logical device segment information--------------------------------------------------------Segment 0 : Present (0,3) WD-WMAY02063263Segment 1 : Present (0,4) WD-WMAY01157345Command completed successfully. -
The only thing that left is to format the new disk and add it to the system.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152[root@linux ~]# fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previouscontent won't be recoverable.The number of cylinders for this disk is set to 242806.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): pDisk /dev/sdb: 1997.1 GB, 1997148258304 bytes255 heads, 63 sectors/track, 242806 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id SystemCommand (m for help): nCommand actione extendedp primary partition (1-4)pPartition number (1-4): 1First cylinder (1-242806, default 1):Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-242806, default 242806):Using default value 242806Command (m for help): pDisk /dev/sdb: 1997.1 GB, 1997148258304 bytes255 heads, 63 sectors/track, 242806 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesDevice Boot Start End Blocks Id System/dev/sdb1 1 242806 1950339163+ 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.WARNING: Re-reading the partition table failed with error 16: Device or resource busy.The kernel still uses the old table.The new table will be used at the next reboot.Syncing disks.
The warning is not a problem because we can see and access /dev/sdb1 already.
123456789101112131415161718192021222324[root@linux ~]# mke2fs -j -m0 /dev/sdb1mke2fs 1.39 (29-May-2006)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)243793920 inodes, 487584790 blocks0 blocks (0.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=429496729614880 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,102400000, 214990848Writing inode tables: doneCreating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 24 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.
Thank you for your time.
0 Comments.