Tuesday, April 12, 2011

Adding SATA storage to a Cobalt RaQ 4

UPDATED: 2011-05-05
Partition manage with fdisk.

Nearly three months without writing anything in this blog. I did a lot of unsuccessful tests, but nothing well until this week. From the last christmas I am trying to compile the 6.5.18 CentOS kernel for the Cobalt servers. I have a valid patch but the resulting rpm package is bigger than 30MB. I will check this before put on a server. I'm using a Sun LX50 with the latest BlueOnyx for this job.

But last week a new VIA chipset SATA card arrived and yesterday I did a new test. I had a lot of problems with my previous SIL3112 card, it was recognized but the hard disk was not. I tested various hd's and some of them were recognized but never with a good stability.




For this test I used my backup server, a RaQ 4i with a 80GB hd for boot the machine and a WD Raptor SATA 150GB as additional storage. It's a 10k disk but I don't have any other SATA hd at home with no use at the moment. This machine was instaled with a fully updated Strongbolt OS, with the 2.6.20 kernel from OSOffice.

The first part of the test was to install the latest kernel I published: 2.6.9-89.0.23-cobalt. Wow, near one year ago! I have o compile a new one...

With this kernel the SATA card and hard disk was correctly recognized as you can see in the next capture of the hardware information page.

This was the easy part. To use this hard disk as storage for BlueQuartz we need to move our /home partition to it. Here you can see how the first hard disk was before any change:


Now the not easy part:
  • Login to the server as root.
  • Check if the hard disk appears on fdisk. As you can see it was formatted with NTFS:
[root@cobalt ~]# fidsk -l
Disk /dev/hda: 80.0 GB, 80026361856 bytes




255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1               1         250     2008093+  83  Linux
/dev/hda2             251         500     2008125   83  Linux
/dev/hda3             501         625     1004062+  82  Linux swap
/dev/hda4             626        9729    73127880    5  Extended
/dev/hda5             626         875     2008093+  83  Linux
/dev/hda6             876        9729    71119723+  83  Linux
Disk /dev/sda: 150.0 GB, 150039945216 bytes
255 heads, 63 sectors/track, 18241 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
   Device Boot      Start         End      Blocks   Id  System

/dev/sda1   *           1       18242   146521088    7  HPFS/NTFS
  •  Start fdisk:
[root@cobalt ~]# fdisk /dev/sda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 18241.
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)
  • Create a new DOS label. Im not sure if in my cas was needed because the hard disk had one but... Use the 'o' command
Command (m for help):o
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 18241.
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): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
  • As you can see above fdisk reported an error reading the partition table but nothis was wrong here.
  • Delete existent partitions (if necessary) and create the new one and then change the system disk ID:
# fdisk /dev/sda1
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

The number of cylinders for this disk is set to 18241.
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): d
No partition is defined yet!

Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-18241, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-18241, default 18241):
Using default value 18241

Command (m for help): t
Selected partition 1
Hex code (type L to list codes):83

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
  • Here I rebooted the server.
  • Create the ext3 filesystem: # mkfs.ext3 /dev/sda1
  • Now we need to mount the new hard disk to a temporary folder:
# mkdir /tmpmnt
# mount /dev/sda1 /tmpmnt
  • Copy all files from /home to /tmpmnt: # cp -axv /home/* /tmpmnt
  • Unmount the new hard disk: # umount /tmpmnt
  • Create a backup of the old /home partition (I was not able to do that part last time because an error message: Files in use):
# mkdir /oldhome
# mv /home /oldhome

# mkdir /home
# mount -t ext3 /dev/sda1 /home
  • Now we have to modify the /etc/fstab file to make the new partition automount at boot time. Just change hda6 to sda1. My file is this:
  • And the last part is to reboot!!!!!! Here you can see the result, a near 150GB home partition in a SATA hard disk!


Now it's time to check if everithing is OK, a will boot up the server in a week or two and see what happens in a 24/7 work.

IMPORTANT NOTE: During these test I found some problems with fdisk. IF fdisk returns a WARNING when you type the command 'w' (write), usually the hard disk partition is not stored on the hard disk. This is the message
WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table
The new table will be used at the next reboot.
I had this problem until I was able to delete the NTFS partition with FDSIK (the firsts attempts fdisk didn't show the old partition table). Then you can check the results:
# fdisk -l

Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 250 2008093+ 83 Linux
/dev/hda2 251 500 2008125 83 Linux
/dev/hda3 501 625 1004062+ 82 Linux swap
/dev/hda4 626 9729 73127880 5 Extended
/dev/hda5 626 875 2008093+ 83 Linux
/dev/hda6 876 9729 71119723+ 83 Linux

Disk /dev/sda: 150.0 GB, 150039945216 bytes
255 heads, 63 sectors/track, 18241 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 18241 146520801 83 Linux

Friday, January 21, 2011

Do you know XMing?

Sometime ago I was thinking to buy a Sun Sparc workstation. I always liked the Sun Blade 1000/2000 series but the last year the prices of Blade 1500/2500 were going down. Now you can buy a Sun Blade 2500 very cheap.

But before buy a new machine -and look for space at home- I decided to play a little more with my Sun Fire V120. I have a PGX32 VGA card for it and changued the fans for a new low noise ones but what I wanted to do is to connect to the server with an X server.

A quick search in the web and I found an small list of X servers for Windows (I have Vista on my laptop), most of them paid systems with a lot of functions. One of them is free: XMing. This is a very little tool but very useful. Just install XMing on your Window machine and you can connect to the server. More info here.

I didn't need any special cofiguration n the V120: it was reinstalled with the latest Sun Solaris -sorry, Oracle Solaris now- at the end of 2010 and nothing more was done.

The process of open a new connection is very easy:

 - Start XLaunch. At the first screen I choose 'One Window'. The display number must be 10.

  - At the second screen select 'Open session via XDMCP'.

 The next step is to indicate the server address. Type the ip address of  the server or select "Search" if you only have one.

  - I leave the "additional parameters" values as default.

  - Now you can save the configuration in a file to reuse it (I saved it on the desktop to use as a fast link).

And here you are my Solaris login screen on my laptop

This is not a fast way to work with an Sparc workstation but it's enough to play with Java desktop or CDE:

Wednesday, January 19, 2011

How to enable AWStats on Strongbolt

Today I started to play with my backup RaQ 4 server. It's loaded with Strongbolt and looking at the hard disk I found that AWStats is installed by default but pointing a web browser to www.myaddress.net/awstats only gave me an small box asking for a user and password but never I was able to log in.

I remembered there is a post in the Strongbolt forums but with no good solution. A new search and I found this on the closed Nuonce Forums. In fact Strongbolt has AWStats installed but is missing one perl library that is needed to authenticate users in the systems: perl-suidperl.

Just need to install this library and then you can log with the vsite admin password:
[root@web etc]# yum install perl-suidperl

Setting up Install Process
Setting up repositories
update        100% =========================    951 B 00:00
BlueQuartz 100% =========================    951 B 00:00
base           100% =========================   1.1 kB 00:00
addons       100% =========================    951 B 00:00
extras         100% =========================   1.1 kB 00:00
Reading repository metadata in from local files
Excluding Packages from CentOS-4 - Updates
Finished
Excluding Packages from CentOS-4 - Base
Finished
Excluding Packages from CentOS-4 - Addons
Finished
Excluding Packages from CentOS-4 - Extras
Finished
Parsing package install arguments
Resolving Dependencies
> Populating transaction set with selected packages. Please wait.
> Downloading header for perl-suidperl to pack into transaction set.
perl-suidperl-5.8.5-53.el    100% =========================    20 kB 00:00
> Package perl-suidperl.i386 3:5.8.5-53.el4 set to be updated
> Running transaction check

Dependencies Resolved

================================================================
Package                Arch            Version              Repository                 Size
================================================================
Installing:
 perl-suidperl         i386             3:5.8.5-53.el4    update                       112 k

Transaction Summary
================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 112 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): perl-suidperl-5.8.    100% =========================     112 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: perl-suidperl ######################### [1/1]

Installed: perl-suidperl.i386 3:5.8.5-53.el4
Complete!
[root@web etc]#
Remeber that lo log in the Statistics page tou need the vsite admin usr and password, not the server admin password!

Tuesday, September 14, 2010

Wacom Graphire2 and Irix update

Following this post in the Nekochan forums, I did some more test with my Wacom Graphire2 USB tablet. The goal was to check if pressure levels works with the sgi driver, the driver supplied with the Irix distribution cd's.

A quick search returned two interesting pages:

The results are good. Not fantastic but pressure levels are working. I never used a tablet before but in my case to use the pressure level function I have to use a button to draw. While I push the button I can move the pencil away and closer to change the with of the draw. If I press the tablet the color changes to background color. (Extracted from my post in Nekochan forums).

In the following pic you can find an example of the pressure changes in size and color. The config file is also open:


The next job will be check if the Absolute Mode works. I checked some different setting but with no results.
We will see...

Wednesday, September 8, 2010

Solaris 10 release 9/10

Don't forget to download the new release of Oracle (Sun) Solaris 10. Just launched. Check all the new features in the Oracle Solaris web page. Unfortunately the old Sun accounts aren't running and a new Oracle registration is needed until the old accounts are consolidated.

Sun Fire V120 as NAS part 8: Now with UFS filesystem (ZFS to UFS)

Before the summer I did a lot of test with a Sun Fire V120 Sparc server. At the time I used Solaris 10/09 installed in a 37GB disk and a ZFS array of three 18GB disk ia a Storedge S1. The results were bad in terms of network file transfer and I was thinking to reinstall everyrhin with a new UFS configuration.

Thats seems an easy job but The first step was so difficult: Solaris didn't want to changue the ZFS filesystem to UFS. After a lt of searching a I fund the good solution for Sparc Solaris (usually all the information was for x86 Solaris with a different format utility) here. Just a few steps are necessary.

1. We need to use the format utility once with each disc. Here how I re-labeled the first hd (SMI label needed):
# format -e c1t1d0
selecting c1t1d0
[disk formatted]

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
        inquiry    - show vendor, product and revision
        scsi       - independent SCSI mode selects
        cache      - enable, disable or query SCSI disk cache
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Auto configuration via format.dat[no]? no
format> quit
#
Now repeat with the next 4 hd's.

2. Partitioning is more complicated.
  • Start the format utility: # format c1t1d0.
  • Select in the menu: partition, an then  modify.
  • Select All free hog:
Select partitioning base:

        0. Current partition table (unnamed)

        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 - 7505       16.86GB    (7506/0/0) 35368272
  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)          
  • At this stage we can change the partition sizes (this is a 18GB hd):
Do you wish to continue creating a new partition
table based on above table[yes]?
Free Hog partition[6]? 7
Enter size of partition '0' [0b, 0c, 0.00mb, 0.00gb]: 16gb
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 - 7121       16.00GB    (7122/0/0) 33558864
  1       swap    wu       0               0         (0/0/0)           0
  2     backup    wu       0 - 7505       16.86GB    (7506/0/0) 35368272
  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    7122 - 7505      883.50MB    (384/0/0)   1809408

Okay to make this the current partition table[yes]?
Enter table name (remember quotes): array

Ready to label disk, continue? yes

partition> quit
format> quit
#
3. Now is time to copy the partition table to the other hd's using:
# prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c2t1d0s2
Here I had an small problem because one of the hard disks is different, also 18 GB and Seagate but different model. I had to do all the partitioning one more time but with the same zise partitions.
Total disk cylinders available: 14076 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders         Size            Blocks
  0 unassigned    wm       0 - 13283       16.00GB    (13284/0/0) 33555384
  1 unassigned    wm       0                0         (0/0/0)            0
  2     backup    wu       0 - 14075       16.95GB    (14076/0/0) 35555976
  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   13284 - 14072      973.15MB    (789/0/0)    1993014
4. This step is easy, copy the metadata:
# metadb -a -f c1t1d0s7 c2t1d0s7 c2t2d0s7 c2t3d0s7
5. And create the Raid 5 array!!!
# metainit d0 -r c1t1d0s0 c2t1d0s0 c2t2d0s0 c2t3d0s0
d0: RAID configurado (RAID is setup)
Now the array is created but is not ready. Using metastat several times we can check the status of the build:
# metastat d0
d0: RAID
    Estado: Inicializando
    Inicialización en progreso:  0.4% terminado
    Entrelazado: 32 bloques
    Tamaño: 100653032 bloques (47 GB)
Dispositivo original:
     Tamaño: 100657536 bloques (47 GB)
        Dispositivo   Bloque de in Base        Estado Reubi  Repuesto en marcha
        c1t1d0s0          5042        No Inicializand    Sí
        c2t1d0s0          5042        No Inicializand    Sí
        c2t2d0s0          2856        No Inicializand    Sí
        c2t3d0s0          5042        No Inicializand    Sí

Device Relocation Information:
Device   Reloc  Device ID
c1t1d0   Sí     id1,sd@SFUJITSU_MAN3184M_SUN18G_02Z33997____
c2t1d0   Sí     id1,sd@SFUJITSU_MAN3184M_SUN18G_02Z35960____
c2t2d0   Sí     id1,sd@SSGI_____ST318404LC______3BT2FCQL0000V121048Z
c2t3d0   Sí     id1,sd@SFUJITSU_MAN3184M_SUN18G_02Z35919____

6. Finished!!!
# metastat d0
d0: RAID
    Estado: Correcto
    Entrelazado: 32 bloques
    Tamaño: 100653032 bloques (47 GB)
Dispositivo original:
     Tamaño: 100657536 bloques (47 GB)
        Dispositivo   Bloque de in Base        Estado Reubi  Repuesto en marcha
        c1t1d0s0          5042        No     Correcto    Sí
        c2t1d0s0          5042        No     Correcto    Sí
        c2t2d0s0          2856        No     Correcto    Sí
        c2t3d0s0          5042        No     Correcto    Sí

Device Relocation Information:
Device   Reloc  Device ID
c1t1d0   Sí     id1,sd@SFUJITSU_MAN3184M_SUN18G_02Z33997____
c2t1d0   Sí     id1,sd@SFUJITSU_MAN3184M_SUN18G_02Z35960____
c2t2d0   Sí     id1,sd@SSGI_____ST318404LC______3BT2FCQL0000V121048Z
c2t3d0   Sí     id1,sd@SFUJITSU_MAN3184M_SUN18G_02Z35919____

7. When the array is finished we can create the filesystem (and wait a lot more time):
# newfs -i 8192 /dev/md/rdsk/d0
newfs: construir un nuevo sistema de archivos /dev/md/rdsk/d0: (y/n)? y
 
Advertencia: 4120 sector(es) en el último cilindro sin asignar
/dev/md/rdsk/d0:        100653032 sectores en 16383 cilindros de 48 pistas, 128 sectores
        49147,0MB en 1024 grupos de cilindros (16 c/g, 48,00MB/g, 5824 i/g)
copias de seguridad super-bloque (para fsck -F ufs -o b=#) en:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Inicializando grupos de cilindros:
....................
copias de seguridad del superbloque de los últimos 10 grupos de cilindros en:
 99687200, 99785632, 99884064, 99982496, 100080928, 100179360, 100277792, 100376224, 100474656, 100573088
Sorry, I installed Solaris in Spanish but....

9. Now we can mount the filesystem in a directory and it will be ready for use. The same name as my first atempt with ZFS:
# mkdir /fsshared
# mount -F ufs /dev/md/dsk/d0 /fsshared

10. The final step is to make the mount persistent.we need to insert a new line in the /etc/vfstab (data separated with tabs)
/etc/vfstab
#device         device          mount           FS      fsck    mount   mount
#to mount       to fsck         point           type    pass    at boot options
#
fd      -       /dev/fd fd      -       no      -
/proc   -       /proc   proc    -       no      -
/dev/dsk/c1t0d0s1       -       -       swap    -       no      -
/dev/dsk/c1t0d0s0       /dev/rdsk/c1t0d0s0      /       ufs     1       no
-
/dev/dsk/c1t0d0s7       /dev/rdsk/c1t0d0s7      /export/home    ufs     2
yes     -
/devices        -       /devices        devfs   -       no      -
sharefs -       /etc/dfs/sharetab       sharefs -       no      -
ctfs    -       /system/contract        ctfs    -       no      -
objfs   -       /system/object  objfs   -       no      -
/dev/md/dsk/d0  /dev/md/rdsk/d0 /fsshared       ufs     2       yes     -
swap    -       /tmp    tmpfs   -       yes     -

Monday, June 21, 2010

Swapping my server

I switched my main web server. My beloved RaQ 4i had been working for the last three years 24/7. Being a second hand server with an old hard disk I feel a little bad and some time ago I decided to exchange for anther RaQ 4i I had as spare.

This new/old server has the same specs as the old one but with two Seagate 120 GB in RAID 1 configuration. I more confident with this setup. Obviously it runs Strongbolt 1 (CentOS 4 + BlueQuartz) but with no addon packages installed as I don't need anything outside Strongbolt.

I restored all the files of the old server (the /downloads/ folder) and it was 14 GB's!. Torrentflux isn't installed as I don't use it since a lot of time ago.

Well I think I have server for a lot of time but I want to switch to one of my RaQ 550. They are newer and powerful servers but before I have to change the power supply fan (and I don't need more power in fact).