Archive for the ‘Hardware’ Category

We have one of these devices that we wanted to get working in linux, specifically RHEL6.

Here’s what we did.

First, you need to install the libftdi libraries. There are rpm packages for those on the EPEL site, if we couldn’t get them directly from RedHat. (I can’t remember where we got those from, but it was pretty easy to find.)

The problem we had was that we wanted the device to be automatically created at login or when it was plugged in. And we didn’t want to have to be root to use it. So here is what we set up.

* Create /etc/sysconfig/modules/ftdi_sio.modules
We are creating this so that the ftdi_sio module is automatically loaded at boot

#!/bin/sh
exec /sbin/modprobe ftdi_sio >/dev/null 2>&1

* Create /etc/modprobe.d/ftdi_sio.conf
This is for the options that we would use with the modprobe command

options ftdi_sio vendor=0x0c52 product=0xe402

Note that we got the vendor and product ids by running lsusb when the device was plugged in.

* Create /etc/rc.d/init.d/setup_Seamax
This is a script to run at startup. It adds the ids of the device to a file. However, that file is not created unless the module is loaded, which is why we did the previous two steps. Also note that this script could be better written, I just copied an old script I had around and edited it.

#!/bin/sh

# setup_Seamax

# chkconfig: 2345 99 10
# description: add device info about Seamax

start() {
  echo -n "Setting up Seamax: "
  echo "0c52 e402" > /sys/bus/usb-serial/drivers/ftdi_sio/new_id
  RETVAL=$?
  echo
  return $RETVAL
}

case "$1" in 
  start)
    start
    ;;

  *)
    echo "Usage: $0 {start}"
    exit 1

esac

exit $RETVAL
* Add the script to chkconfig and make sure that it will start on boot
# chkconfig --add setup_Seamax
# chkconfig --list setup_Seamax
setup_Seamax   	0:off	1:off	2:on	3:on	4:on	5:on	6:off

* Create /etc/udev/rules.d/10-uc.rules
This will run when the device is detected and will set the owner/permissions that we want

SUBSYSTEM=="tty", ATTRS{idVendor}=="0c52", ATTRS{idProduct}=="e402", OWNER="kelby", MODE="0666"

REBOOT

After reboot, you should see /dev/ttyUSB0 as being owned by our regular user.

$ ll /dev/ttyUSB0 
crw-rw-rw- 1 kelby dialout 188, 0 Oct 11 09:47 /dev/ttyUSB0

Even though the parted command shows the partition as ext3, you can format it as ext4.

(parted) mklabel gpt
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to
continue?
Yes/No? Yes                                                               
(parted) unit TB
(parted) mkpart primary 0.00TB 10.00TB
(parted) p                                                                
Model: LSI MR9261-8i (scsi)
Disk /dev/sda: 9.99TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name     Flags
 1      0.00TB  9.99TB  9.99TB  ext3         primary

(parted) quit                                                             
Information: You may need to update /etc/fstab.

[root@mh ~]# mkfs.ext4 /dev/sda1
mke2fs 1.42.9 (28-Dec-2013)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
305025024 inodes, 2440183808 blocks
122009190 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
74469 block groups
32768 blocks per group, 32768 fragments per group
4096 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done       

[root@mh ~]# blkid
/dev/sda1: UUID="1485be35-8319-4a49-b0bd-9ee465303b41" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7f0e3ef-3e72-4bc9-849a-90dde882f07f" 
/dev/sdb1: UUID="6ca14ed0-e5e0-422a-9e82-ea72fc84516b" TYPE="ext4" 
/dev/sdb2: UUID="ceb6e531-4a0a-49b9-9e59-d8f1ae4593c6" TYPE="swap" 
/dev/sdb3: UUID="ab27cea4-abc8-49d8-894f-2c39408b196f" TYPE="ext4" 
[root@mh ~]# blkid|grep sda
/dev/sda1: UUID="1485be35-8319-4a49-b0bd-9ee465303b41" TYPE="ext4" PARTLABEL="primary" PARTUUID="a7f0e3ef-3e72-4bc9-849a-90dde882f07f" 
[root@mh ~]# blkid|grep sda >> /etc/fstab
[root@mh ~]# vi /etc/fstab
[root@mh ~]# mount -a

Commands to use to partition a new 3TB disk with parted.

[ ~]# parted /dev/sdg
GNU Parted 2.1
Using /dev/sdg
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Error: /dev/sdg: unrecognised disk label                                  
(parted) mklabel gpt                                                  
(parted) mkpart primary ext3 1 -1                                         
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? C                                                          
(parted) print                                                            
Model: ASMT 2105 (scsi)
Disk /dev/sdg: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]? ext3                                           
Start? 0%                                                                 
End? 100%

Using percentages worked better than trying to specify the start/stop sectors. Not sure why.

[ ~]# mkfs.ext3 /dev/sdg1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
183148544 inodes, 732566272 blocks
36628313 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
22357 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544

[ ~]# tune2fs -c0 -i0 /dev/sdg1

The spare disk on one of my raids failed. Here’s how to replace.

[root@cp x86_64]# ./tw_cli 
//cp> info

Ctl   Model        (V)Ports  Drives   Units   NotOpt  RRate   VRate  BBU
------------------------------------------------------------------------
c8    9650SE-8LPML 8         6        1       0       1       1      -        

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     DEVICE-ERROR     u?     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> maint remove c8 p1
Removing port /c8/p1 ... Done.


//cp> info c8 

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     NOT-PRESENT      -      -           -             -
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     NOT-PRESENT      -      -           -             -
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               -      465.76 GB   976773168     WD-WMAYP5602245     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> /c8/u0 start rebuild disk=1
Sending rebuild start request to /c8/u0 on 1 disk(s) [1] ... Failed.
(0x0B:0x0031): Unit is ok

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               -      465.76 GB   976773168     WD-WMAYP5602245     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> /c8 add type=spare disk=1
Creating new unit on controller /c8 ... Done. The new unit is /c8/u1.
WARNING: This Spare unit may replace failed drive of same interface type only.

//cp> info c8

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    SPARE     OK             -       -       -       465.753   -      OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u1     465.76 GB   976773168     WD-WMAYP5602245     
p2     OK               u0     465.76 GB   976773168     WD-WCAS84972002     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCASY8726207     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cp> 
[root@cps4 ~]# parted /dev/sda
GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: LSI 9750-8i DISK (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mklabel gpt                                                      
Warning: The existing disk label on /dev/sda will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? Yes                                                               
(parted) mkpart primary 0 -0                                              
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? Cancel                                                     

(parted) mkpart primary ext3 1 -1
(parted) print                                                            
Model: LSI 9750-8i DISK (scsi)
Disk /dev/sda: 12.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  12.0TB  12.0TB               primary

[root@cps4 ~]# mkfs -t ext3 /dev/sda1
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
732422144 inodes, 2929670656 blocks
146483532 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
89407 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
	4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
	102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
	2560000000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 36 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@cps4 ~]# tune2fs -c0 -i0 /dev/sda1
tune2fs 1.41.12 (17-May-2010)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds

RHEL6 seems to prefer to use UUIDs in /etc/fstab instead of device names. So, will want to do something like this to get the uuid.

[root@server]# blkid|grep sda1 >> /etc/fstab

This then gets added to /etc/fstab.
/dev/sda1: UUID=”a7a23967-f2c5-43a7-9245-270a818b6106″ SEC_TYPE=”ext2″ TYPE=”ext3″

Edit the line so it looks like this:
UUID=a7a23967-f2c5-43a7-9245-270a818b6106 /local/s13 ext3 defaults 1 2

This laserjet printer would not print anything. It’s connected through the network and I could get to the webpage for it, but it would not print.

Solution:
Hold down both arrow keys and power off and on. Keep holding the keys down until get to Language -> English prompt. Then, just go through and re-setup the printer. After that, things printed ok again.

After rebooting a node with a spare drive in the raid, I got errors saying that the spare drive was an inoperable unit.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    RAID-5    INOPERABLE     -       -       64K     1862.61   OFF    OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u1     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

To fix this, I just deleted the unit (u1) and added the disk back as a spare.

//cps1> /c0/u1 del
Deleting /c0/u1 will cause the data on the unit to be permanently lost.
Do you want to continue ? Y|N [N]: Y
Deleting unit c0/u1 ...Done.


//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               -      465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

//cps1> /c0 add type=spare disk=2
Creating new unit on controller /c0 ... Done. The new unit is /c0/u1.
WARNING: This Spare unit may replace failed drive of same interface type only.

//cps1> info c0

Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       64K     1862.61   ON     OFF    
u1    SPARE     OK             -       -       -       465.753   -      OFF    

Port   Status           Unit   Size        Blocks        Serial
---------------------------------------------------------------
p0     OK               u0     465.76 GB   976773168     WD-WCANU2126397     
p1     OK               u0     465.76 GB   976773168     WD-WCANU2051520     
p2     OK               u1     465.76 GB   976773168     WD-WCANU2030999     
p3     OK               u0     465.76 GB   976773168     WD-WCAS84739115     
p4     OK               u0     465.76 GB   976773168     WD-WCANU2114264     
p5     OK               u0     465.76 GB   976773168     WD-WCANU2051215     
p6     NOT-PRESENT      -      -           -             -
p7     NOT-PRESENT      -      -           -             -

That is how it should look.

The difference between these two cards is that the SGL card comes without cables.

We have a computer running linux that we’d like to make dual-boot. Normally when I do this, I install windows first and then linux, so the grub works on the master boot record. By installing windows second, it’s going to screw up our mbr and we won’t be able to boot to linux without some changes.

We have a second problem, in that, I could not get the windows installation disk to run with the linux disk connected. (My initial plan was to keep linux on the first sata disk and install windows on a second sata disk.) This was solved by disconnecting the linux disk and hooking up a blank disk to use for windows. With just the new setup, the windows install proceeded as it normally does.

Ok, windows is installed and I’m booting into rescue mode on an RHEL 5 disk. First problem, it doesn’t like the disk I’m using. Solution is to not say the disk is local, but to use a network image from our RHEL Satellite Server. This means that I have to set up networking now too. Small delay…

It took a while to boot, but it finally came up. First problem was that it didn’t like any of my other disks, one of which, is where I installed windows. So I had to say ‘No’ to initializing all these disks because it would erase my windows installation. Now at sh-3.2# prompt, need to do:

sh-3.2# chroot /mnt/sysimage

In my /etc/fstab, the / and /boot filesystems are mounted using their label, so I don’t need to change anything there. Fdisk -l /dev/sda, shows that this is the windows disk. So, I want to install grub on /dev/sda. First edit /etc/grub.conf and add WinXP section.

title WindowsXP
  rootnoverify (hd0,0)
  chainloader +1

and change all the root(hd0,0) in the linux sections to root(hd1,0) because I switched the order of the drives in the computer.

Then, install:

sh-3.2# grub-install /dev/sda

Got an error that /dev/sdb1 does not have any corresponding bios drive. So need to edit /boot/grub/device.map.

# this device map was generated by anaconda
(hd0) /dev/sda
(hd1) /dev/sdb

Rerun grub-install:

sh-3.2# grub-install /dev/sda
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not.  If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

# this device map was generated by anaconda
(hd0) /dev/sda
(hd1) /dev/sdb

Reboot and grub starts. WindowsXP is a selection. First, check if linux will boot. Worked ok. Check Windows, works ok too. Now can go in and install drivers and everything else required for Windows.