Tuesday, January 14, 2014

hacking eGreat EG-R1 - updated (new best FW)

Hi,

after 3 years of using this little box I've spend some Christmas holiday time and did a research on the Internet looking for an actual best FW for it.

I have tested approx. 6 different FW's and here is my favourite, most stable, fast and usable:  CS_r0.5.0a_ACRyan_v7.4.6.r8755


Little bit of customization I suggest after FW update:
(enable samba in settings-network, keep build transmission disabled)

1.) Enable swap
2.) Install latest Transmission 2.8.x


add 1.) Enable Swap
 Prerequisity:
- hdisk with linux-swap partition (easy created in gparted over Ubuntu live)
- download nountSwap script from here:
http://www.acryan.com/forums/viewtopic.php?f=146&t=18076

- copy script to your hard drive
- login over terminal to the player and copy script from hd to /usr/local/etc/mountSwap
- do chmod 755 /usr/local/etc/mountSwap
- execute the script, you should see output like this:

        Identification of swap-partition:
        -> Swap-partition was found on /dev/sdb2

        Extra wait, contribute of FW r7317

        Activate swap-partition:
        -> swap-partition (/dev/sdb2) enabled

        Make swap settings:
        -> min_free_kbytes = 5120
        -> swappiness = 60

        mountSwap end: everything is okay

If it's working, put the script on the end of the start script /usr/local/etc/rcS:
 /usr/local/etc/mountSwap &

- reboot the player and login back, verify that swap is activated automatically:

~ # cat /proc/swaps
Filename                                Type            Size    Used    Priority
/mnt/rd/swap.img                        file            32      0       -1
/dev/scsi/host0/bus0/target0/lun0/part2 partition       131064  1272    -2

~ # free
              total         used         free       shared      buffers
  Mem:       120632       111804         8828            0         1332
 Swap:       131096         1272       129824
Total:       251728       113076       138652

It looks OK.


add 2.) Install latest Transmission 2.8.x

Now, it's little bit complicated but still easy to do.

- enable packaging system:

mount -o remount rw /  

mkdir /opt/tmp; cd /opt/tmp


wget http://www.kovari.priv.hu/download/ipkg-cl.tgz; tar -xvf ipkg-cl.tgz; rm ipkg-cl.tgz

mv /opt/tmp/ipkg-cl /bin

wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk

ipkg-cl install uclibc-opt_0.9.28-13_mipsel.ipk

wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk

ipkg-cl install ipkg-opt_0.99.163-10_mipsel.ipk

rm *.ipk

- download list of packages:
/opt/bin/ipkg update

- install latest transmission into /opt:

/opt/bin/ipkg install transmission

-  create a transmission directory on hdisk and put there config file:


~ # df -h
Filesystem                Size      Used Available Use% Mounted on
...
/dev/scsi/host0/bus0/target0/lun0/part1      1.8T      1.1T    723.9G  61% /tmp/usbmounts/sdb1


~ # mkdir /tmp/usbmounts/sdb1/BT

- put there a "settings.json" file, here is example:
 (insert your password into line" "rpc-password": "your_password",)

{
    "alt-speed-down": 512,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 25,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": true,
    "blocklist-url": "http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz",
    "cache-size-mb": 4,
    "dht-enabled": true,
    "download-dir": "/tmp/usbmounts/sdb1/BT",
    "download-queue-enabled": true,
    "download-queue-size": 5,
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "//Downloads",
    "incomplete-dir-enabled": false,
    "lpd-enabled": false,
    "message-level": 2,
    "peer-congestion-algorithm": "",
    "peer-id-ttl-hours": 6,
    "peer-limit-global": 20,
    "peer-limit-per-torrent": 20,
    "peer-port": 51555,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "prefetch-enabled": 1,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{db0e9c0d08d867cb803e1ee0cec8dc5f7537bde2KmBzzO5I",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "root",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": false,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 45,
    "speed-limit-up-enabled": true,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true
}


- relink transmission web page:
rm -rf /tmp/www
ln -s /opt/share/transmission/web /tmp/www


- run transmission and check if webpage is working: 
nice -n 15 /opt/bin/transmission-daemon -g /tmp/usbmounts/sdb1/BT/

http://box_ip:9091 (login with root/)

- if everything’s OK, modify start script,
put on the end of "/usr/local/etc/rcS":

mount -o remount rw /
sleep 30
nice -n 15 /opt/bin/transmission-daemon -g /tmp/usbmounts/sdb1/BT/


- reboot box and pray that it boot-up OK and everything run fine :-)
reboot

Enjoy the latest Transmission and stable system with swap enabled.

B.

Thursday, January 7, 2010

hacking eGreat EG-R1 (installing torrent client, samba, ssh, plowshare etc..)

Hello,

I am presenting here my way how to run some useful applications on this (e)great device.

IMPORTANT: This guide is not for the beginners. Some linux skills are necessary, otherwise you can broke your box! Please be careful, never proceed to the next step until previous was successfully done. Good luck.

Step 1. Preparation of environment, installation of ipkg package management system (must be done)

What we need:
- ssh/telnet client (for windows it's putty - http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe
- USB memory stick (256M+) or USB/SATA harddisk which will be formated as ext3 filesystem, SATA disk is the best solution here

So let's start:
- connect USB stick to the box and power it on.
- launch putty and open a Telnet connection to ip address of the box, log in as "root"
- check if you have connection to the Internet:
ping www.google.com
if you don't see "is alive!", something's wrong

- let's check if we see USB stick "/tmp/usbmounts/sda1" (if we are using USB disk with more than one partition, we will see also sda2, sda3 etc...).

mount
/dev/root on / type yaffs2 (ro,noatime)
none on /dev type devfs (rw)
none on /proc type proc (rw,nodiratime)
devpts on /dev/pts type devpts (rw)
none on /sys type sysfs (rw)
none on /tmp type ramfs (rw)
/dev/mtdblock/2 on /usr/local/etc type yaffs (rw,noatime)
/dev/rd/0 on /mnt/rd type vfat (rw,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1)
/dev/scsi/host2/bus0/target0/lun0/part1 on /tmp/usbmounts/sda1 type vfat (ro)

- see info about free space and disk size (in case of more disk partitions, identify correct partition by it's size:
df -h

NOTICE: note the line with correct partition to notepad for later
examp. "/dev/scsi/host2/bus0/target0/lun0/part1 on /tmp/usbmounts/sda1 type vfat (ro)"

- remount "/" as read/write:
mount / -o remount,rw

- we must free some space in /.
the best way is to substitute any big chinesse bitmap font which we never use with arial.ttf

- in case of 1.0.4.10 firmware do:
cp /usr/local/bin/Resource/tahoma.ttf /usr/local/bin/Resource/yahei.ttf

- in case of 1.0.3.5 firmware do:
cp /usr/local/bin/Resource/tahoma.ttf /usr/local/bin/Resource/yahei.ttf

- in case of 1.0.3.2 firmware do:
cp /usr/local/bin/Resource/arial.ttf /usr/local/bin/Resource/yahei.ttf

- in case of 1.0.2.3 firmware try :
cp /usr/local/bin/Resource/arial.ttf /usr/local/bin/Resource/msyh.ttf
(if is your firmware older than 1.0.2.3, update it)

- format selected partition:
umount /tmp/usbmounts/sda1

mkfs.ext3 -L opt /dev/scsi/host2/bus0/target0/lun0/part1

tune2fs -o journal_data_writeback /dev/scsi/host2/bus0/target0/lun0/part1

- mount it back as ext3:
mount /dev/scsi/host2/bus0/target0/lun0/part1 /tmp/usbmounts/sda1 -o noatime,data=writeback

- create directories and symlinks:
mkdir /tmp/usbmounts/sda1/root; ln -s /tmp/usbmounts/sda1/root /root

mkdir /tmp/usbmounts/sda1/opt; ln -s /tmp/usbmounts/sda1/opt /opt

- correct root profile and environment:
echo -e PATH="/opt/bin:/opt/sbin:\$PATH"\\nHOME=/root\\nTERM=xterm\\nINPUTRC=/etc/inputrc\\nPAGER=more\\nexport PATH TERM INPUTRC PAGER\\nalias mc=\"mc -c\"\\n"" >/root/.profile

cp -p /etc/passwd /etc/passwd.bak; sed "s/root::0:0:root::\/bin\/sh/root::0:0:root:\/root:\/bin\/sh/" < /etc/passwd.bak > /etc/passwd

- create a root password to be secure:
passwd root

exit

- connect back and check if you are now in your home directory on usb disk:
pwd; echo $PATH


Installation of ipkg package system:

mkdir /opt/tmp; cd /opt/tmp

wget http://www.kovari.priv.hu/download/ipkg-cl.tgz; tar -xvf ipkg-cl.tgz; rm ipkg-cl.tgz

mv /opt/tmp/ipkg-cl /usr/local/bin

wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/uclibc-opt_0.9.28-13_mipsel.ipk

ipkg-cl install uclibc-opt_0.9.28-13_mipsel.ipk

wget http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/stable/ipkg-opt_0.99.163-10_mipsel.ipk

ipkg-cl install ipkg-opt_0.99.163-10_mipsel.ipk

rm *.ipk

- download list of packages:
/opt/bin/ipkg update

- test it by installing Nano text editor (we will need it later):
ipkg install nano


Step 2. Auto mounting of /opt and /root after reboot + starting of SSH daemon:
(must be done)

- we need UUID number of our ext3 filesystem:
tune2fs -l /dev/scsi/host2/bus0/target0/lun0/part1 | grep UUID
output will be something like:
Filesystem UUID: a46bd0c3-0479-481b-8b36-cebc69b6c397

note your UUID to notepad, for example "a46bd0c3-0479-481b-8b36-cebc69b6c397"

>>Now be very careful!!!<<
- open the starting script and put following lines at the bottom of file:
NOTE: as k="a46bd0c3-0479-481b-8b36-cebc69b6c397" use your disk UUID!!!

nano /usr/local/etc/rcS
input following text at the bottom of file:

# Mounting /opt and /root
sleep 60
mount / -o remount,rw
rm /opt
rm /root

# my disk UUID:
k="a46bd0c3-0479-481b-8b36-cebc69b6c397"

# disk checking and mounting:
for i in `mount | awk '/\/dev\/scsi\// {print $1}'`
do
if [ `tune2fs -l $i | awk '/UUID/ {print $3}'` = $k ]
then m=`mount | grep $i | awk '{print $3}'`
umount $m
fsck.ext3 -f $i
mount $i $m -o noatime,data=writeback
ln -s "$m/opt" /opt
ln -s "$m/root" /root
fi
done

sleep 1
# starting SSH:
/opt/etc/init.d/S40sshd start
(to save press ctrl+x, then "y")

Ok, so let's reboot the box ant check if everything is OK
reboot

Wait approx 2 minutes and log in back, check if you are in your home directory and if /opt and /root exist:
pwd; ls -lad /opt; ls -lad /root


Step 3. Installation of OpenSSH/SFTP
(strongly recommended if you are connected to the Internet)

ipkg install openssh openssh-sftp-server

- reboot wait approx. 2 minutes and try to connect via SSH:
reboot
(in putty change type of connection from Telnet to SSH and log in back as root)

OPTIONAL:
If you want to disable Telnet (we have SSH working now) just comment (#) following line in /etc/inetd.conf:
#telnet stream tcp nowait root /usr/sbin/telnetd telnetd

How to use SFTP:
- connect via sftp client to the same ip and port as SSH.
For more detailed configuration you have to modify "/opt/etc/openssh/sshd_config".
More info here - https://help.ubuntu.com/community/SSH/OpenSSH/Configuring

If you want to have all disks mounted as writable, add this to rcS at the bottom:
(good idea if you plan to use SAMBA or torrent client)
nano /usr/local/etc/rcS

# remount disks as "rw"
for i in `mount | awk '/\/tmp\/usbmounts\/sd/ {print $3}'`
do mount $i -o remount,rw
done


Step 4. Installation of Transmission torrent client

- install packages:
ipkg install transmission

mkdir /root/transmission

- create a directory for downloads:
mkdir /root/downloads

- create a config file, adjust settings as you need, specially "rpc-username" and "rpc-password", more info here: http://trac.transmissionbt.com/wiki/EditConfigFiles

nano /root/transmission/settings.json
paste following text in to it:
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": false,
"dht-enabled": true,
"download-dir": "\/root\/downloads",
"encryption": 0,
"lazy-bitfield-enabled": true,
"message-level": 2,
"open-file-limit": 16,
"peer-limit-global": 120,
"peer-limit-per-torrent": 30,
"peer-port": 51413,
"peer-port-random-high": 65535,
"peer-port-random-low": 49152,
"peer-port-random-on-start": false,
"peer-socket-tos": 0,
"pex-enabled": true,
"port-forwarding-enabled": true,
"preallocation": 1,
"proxy": "",
"proxy-auth-enabled": false,
"proxy-auth-password": "",
"proxy-auth-username": "",
"proxy-enabled": false,
"proxy-port": 80,
"proxy-type": 0,
"ratio-limit": 1.0000,
"ratio-limit-enabled": false,
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "your_password",
"rpc-port": 9091,
"rpc-username": "admin",
"rpc-whitelist": "*.*.*.*",
"rpc-whitelist-enabled": false,
"speed-limit-down": 150,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"umask": 18,
"upload-slots-per-torrent": 7
}

- set up a web engine for it:
rm -rf /tmp/www

ln -s /opt/share/transmission/web/ /tmp/www

- finally let's run the transmission daemon:
/opt/bin/transmission-daemon -g /root/transmission/

- wait for a moment and try to connect to transmission web page, it should work now:
http://ip_of_box:9091

IMPORTANT: If you want to change any setting in "settings.json" , you must first stop transmission daemon:
killall transmission-daemon; sleep 1;killall transmission-daemon
then edit "settings.json" and start is back

- if the transmission webpage is working OK, add to the start script:
nano /usr/local/etc/rcS

# starting Transmission:
rm -rf /tmp/www
ln -s /opt/share/transmission/web/ /tmp/www
/opt/bin/transmission-daemon -g /root/transmission/

- reboot box to test start script:
reboot
wait approx. 2 minutes and access Transmission web page, it should work.


Step5. SAMBA installation
(if you want to access your box over home network)

- download EG-R1_BT_SAMBA package from eGreat site and unpack:
cd; wget http://www.egreatworld.com/download/EG-R1_BT_SAMBA.rar

ipkg install unrar

unrar x EG-R1_BT_SAMBA.rar

cd EG-R1\ BT_SAMBA_20091017EN/

ipkg install samba_3.0.23c_mipsel.ipk

cd; rm -rf EG-R1*

mv /tmp/package /opt/

ln -s /opt/package /tmp/package

- edit smb.conf:
nano /opt/package/samba/lib/smb.conf

- add line:
guest ok=yes
up line "guest account=root"

- change line "domain logons=Yes" to
domain logons=No

- change line "client NTLMv2 auth=yes" to
client NTLMv2 auth=no

- add at the bottom:
[Storage]
comment = Storage
browseable = yes
writable = yes
path = /tmp/usbmounts/

- start SAMBA daemons:
/tmp/package/script/samba start

- after a while, you should see box on the network as "Venus"

- edit start script and add at the bottom:
nano /usr/local/etc/rcS

# Samba start
rm /tmp/package
ln -s /opt/package/ /tmp/package
/tmp/package/script/samba start

- reboot box to test SAMBA autostart
reboot
wait approx. 2-3 minutes, then log back in and check if samba is running:
ps -ef | grep mbd

if you see this, it's OK:
378 root 1732 S N /tmp/package/samba/sbin/smbd -D
381 root 1080 S N /tmp/package/samba/sbin/nmbd -D
383 root 1716 S N /tmp/package/samba/sbin/smbd -D

after a while you can access your disks from the home network (tested on Windows7 and XP)


Step 6. Plowshare Download manager
(it supports Megaupload, Rapidshare, 2Shared, 4Shared, ZShare, Badongo, DepositFiles and Mediafire)

- it include programs:
plowdown
plowup
plowdel

- install packages:
ipkg install coreutils imagemagick tesseract-ocr tesseract-ocr-lang-eng grep bash plowshare

- create a symlink (if doesn't exist):
ln -s /proc/self/fd /dev/fd

- add to the rcS script at the bottom:
nano /usr/local/etc/rcS

# plowshare fix
ln -s /proc/self/fd /dev/fd

Usage is very simple, go to the download directory and do:
plowdown http://www.rapidshare.com/files/86545320/Tux-Trainer_25-01-2008.rar
or
plowdown list.txt
(in list.txt is list of links to download, 1 link for line)

To ensure that all links from list will be downloaded, create a simple script in downloads directory:
cd ~/downloads; nano plow_down.sh

while true
do plowdown -m $1
sleep 120
done

chmod +x plow_down.sh

usage is: ./plow_down.sh list.txt

more info here: http://code.google.com/p/plowshare/wiki/Readme

NOTE: the "parse failed.." message mean that all public download slots are occupied, you have to wait 2 minutes and try again


Step 7. Installation of SCREEN
(ideal in combination with plowshare)


We have to solve problem, how to run plowshare in the background, so we don't need to be connected over putty all the time. The "screen" is ideal solution. It's a virtual terminal in which we can run programs, detach it, and reconnect back when we want.

- install package
ipkg install screen

- make a config file:
nano /root/.screenrc

- add following text:
shell -$SHELL
startup_message off
hardstatus alwayslastline '%{= wk}%?%-Lw%?%{r}(%{k}%n*%f%t%?(%u)%?%{r})%{k}%?%+Lw%?%?%= %m/%d %C%A'
activity ''

NOTE: when you put text to nano, it will split this line, correct it to be one:
hardstatus alwayslastline '%{= wk}%?%-Lw%?%{r}(%{k}%n*%f%t%?(%u)%?%{r})%{k}%?%+Lw%?%?%= %m/%d %C%A'

- run the program:
screen -R
( -R will connect us to the already running screen if it exist)

We are now in screen 0 and can start plowdown. To detach terminal just press "ctrl+a" then "d",
(see "[detached]" message). Screen is now running in the background and we can disconnect from putty. To connect back to the screen just run "screen -R".

More information here: http://erdelynet.com/tech/openbsd/my-gnu-screen-config/


Step 8. Installation of rTorrent terminal client

rTorrent is lightweight alternative of Transmission. I am using it because it consume less cpu and memory and I don't need web features of Transmission.

ipkg install rtorrent

- create a temp. directory:
mkdir /root/downloads/rtorrent

- create a config file:
ln -s /opt/etc/rtorrent.conf /root/.rtorrent.rc

- modify it as you need:
nano /root/.rtorrent.rc

- before start is good idea to run screen, because rtorrent can't run in the background as Transmission. So just launch "screen -R" and then run "rtorrent".

- some basic control keys:
backspace - start download torrent link you paste
up, down - move between torrents
left, right - more info about torrent
ctrl + d - stop downloading, 2x remove torrent
ctrl + r - recalculate checksum

more info here:
http://libtorrent.rakshasa.no/wiki/RTorrentUserGuide

Step 9. Installation of NFS server (unfs3)

NFS has better performance then Samba, so why do not use it?

ipkg install portmap unfs3

- add your directory to /etc/exports, in my case "/tmp/usbmount/sda1" and my home network is 192.168.1.0/24 (IP range from 192.168.1.1 to 192.168.1.255):

echo "/tmp/usbmounts/sda1/ 192.168.1.0/24(rw,async,no_root_squash)" >> /etc/exports

- test if NFS is working OK, run:

/tmp/usbmounts/ext3/opt/etc/init.d/S55portmap; /tmp/usbmounts/ext3/opt/etc/init.d/S56unfsd


- add at the end of the start script "/usr/local/etc/rcS":

# NFS start
/tmp/usbmounts/ext3/opt/etc/init.d/S55portmap
/tmp/usbmounts/ext3/opt/etc/init.d/S56unfsd

- reboot.

Regards Brano






When unmirrorlv command failed

So what to do?

1. Make a backup before you do anything

2. Create the map file to specify the PPs you want to remove:
# lquerylv -L `getlvodm -l fslv00` -r > /tmp/mapfile

3. vi /tmp/mapfile and remove all good PP's, keep PP's you want to unmirror.

4. Deallocate the PPs using lreducelv (- s "number_of_lines_in_map_file" )

# lreducelv -l `getlvodm -l fslv00` -s 12 /tmp/mapfile

After we are done we should then see lslv -m fslv00 have only one copy

Example:
lquerylv -L `getlvodm -l fsdwhsas2lv` -r > /tmp/fsdwhsas2lv.map
lreducelv -l `getlvodm -l fsdwhsas2lv` -s 24 /tmp/fsdwhsas2lv.map
mklvcopy -s'y' fsdwhsas2lv 2 hdisk74 (now I can extend mirror to 2nd good disk)
syncvg -l dwh2home24lv


Sunday, February 8, 2009

Duplicate disk in VG

Problem: Duplicate hdisk5 entry in datavg, unable to mount any FS - I/O Error...

# errpt
...
26120107 0502230508 U S LIBLVM PHYSICAL VOLUME DEFINED AS MISSING
5BEAD71B 0502225308 I S LIBLVM Activation of a no quorum volume group w
...

# lspv
hdisk0 0004f53e0bb5ef0a rootvg active
hdisk1 0004f53e62ebfe8b rootvg active
hdisk5 0004f53e18414d17 datavg active <----- only one disk

hdisk2 0004f53e4e337f67 datavg active
hdisk3 0004f53e4e33821c hb_vg1
hdisk4 0004f53e4e338552 hb_vg2

# lsvg -p datavg
datavg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk2 active 789 0 00..00..00..00..00
hdisk5 missing 394 246 79..00..09..79..79 <------ duplicated entry

hdisk5 active 394 394 79..79..78..79..79 <------ duplicated entry


Diagnose:
In the VGDA of the disks is a dupicate entry reffering to hdisk5. That's why the datavg can be varied on, but the hdisk5 is appearing once as active but once as missing and the filesystems can't be mounted.

Working solution:
Rebuilding of datavg to create new VGDA on all hdisks:

Step 1. Create a PP map file for every LV on datavg to recreate it without loosing data.

1.a - if IT'S possible to varyonvg:

# varyonvg datavg
# lsvg -l datavg
datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lvexphome jfs2 4 4 1 closed/syncd /export/home
lvmqhadata jfs2 40 40 1 closed/syncd /MQHA/XZ0T0021/data
lvmqhalog jfs2 8 8 1 closed/syncd /MQHA/XZ0T0021/log
lvoraexe jfs2 96 96 2 closed/syncd /oraexe
lvora jfs2 8 8 1 closed/syncd /oracle/ORACCVP
lvoraarch jfs2 8 8 1 closed/syncd /oracle/ORACCVP/arch
lvoraarchzip jfs2 24 24 1 closed/syncd /oracle/ORACCVP/archzip
lvorabkp jfs2 96 96 1 closed/syncd /oracle/ORACCVP/backup
lvoradat jfs2 440 440 2 closed/syncd /oracle/ORACCVP/dat1
lvwwwexe jfs2 40 40 1 closed/syncd /wwwexe
lvwwwapp jfs2 96 96 2 closed/syncd /wwwapp
lvmaestro jfs2 12 12 1 closed/syncd /opt/maestro
loglv00 jfs2log 1 1 1 closed/syncd N/A
lvoraexp jfs2 64 64 1 closed/syncd /oracle/ORACCVP/export

Example of creating a PP map for lvora LV:

# lsvg -M datavg | awk '/lvora:/ {print $1}' > lvora.map

# cat lvora.map
hdisk2:205
hdisk2:206
hdisk2:207
hdisk2:208
hdisk2:563
hdisk2:564
hdisk2:565
hdisk2:566

1.b - if it ISN'T possible varyonvg:

# lspv
hdisk0 0004f5680c560e39 rootvg active
hdisk1 0004f568615a79b1 rootvg active
hdisk2 0004f53e4e337f67 datavg
hdisk3 0004f53e4e33821c hb_vg1
hdisk4 0004f53e4e338552 hb_vg2
hdisk5 0004f53e18414d17 datavg

grep list of physical volumes belonging to datavg:
# readvgda /dev/hdisk2 | grep "pvh.pv_id:"
pvh.pv_id: 0004f53e4e337f67
pvh.pv_id: 0004f53e18414d17

1st pv_id is a pv1 - 0004f53e4e337f67 (hdisk2)
2nd pv_id is a pv2 - 0004f53e18414d17 (hdisk5) etc...

Now we can start grep a PP map for lvora LV:

# readvgda /dev/hdisk2 | awk '/lvora:/
* pv1:205:1 lvora:1:0:0:0:0:0
* pv1:206:1 lvora:2:0:0:0:0:0
* pv1:207:1 lvora:3:0:0:0:0:0
* pv1:208:1 lvora:4:0:0:0:0:0
* pv1:563:1 lvora:5:0:0:0:0:0
* pv1:564:1 lvora:6:0:0:0:0:0
* pv1:565:1 lvora:7:0:0:0:0:0
* pv1:566:1 lvora:8:0:0:0:0:0

we need to substitute pv1 for hdisk2, pv2 for hdisk5 and clear unnecessary strings...

# readvgda /dev/hdisk2 | awk -F: '/lvora:/ {sub(/\* /,"");sub(/pv1: */,"hdisk2:");sub(/pv2: */,"hdisk5:");print $1":"$2}'
hdisk2:205
hdisk2:206
hdisk2:207
hdisk2:208
hdisk2:563
hdisk2:564
hdisk2:565
hdisk2:566

Create PP map for every LV in VG:

# ls -la *.map
-rw-r--r-- 1 root system 11 May 04 01:09 loglv00.map
-rw-r--r-- 1 root system 44 May 04 01:08 lvexphome.map
-rw-r--r-- 1 root system 132 May 04 01:09 lvmaestro.map
-rw-r--r-- 1 root system 440 May 04 01:08 lvmqhadata.map
-rw-r--r-- 1 root system 88 May 04 01:08 lvmqhalog.map
-rw-r--r-- 1 root system 88 May 04 01:08 lvora.map
-rw-r--r-- 1 root system 88 May 04 01:08 lvoraarch.map
-rw-r--r-- 1 root system 264 May 04 01:08 lvoraarchzip.map
-rw-r--r-- 1 root system 1056 May 04 01:08 lvorabkp.map
-rw-r--r-- 1 root system 4712 May 04 01:09 lvoradat.map
-rw-r--r-- 1 root system 1056 May 04 01:08 lvoraexe.map
-rw-r--r-- 1 root system 704 May 04 01:09 lvoraexp.map
-rw-r--r-- 1 root system 1056 May 04 01:09 lvwwwapp.map
-rw-r--r-- 1 root system 440 May 04 01:09 lvwwwexe.map

Step 2. Varyoff(if is needed) and export datavg

# varyoffvg datavg
# exportvg datavg

Step 3. Create NEW datavg with correct VGDA

# mkvg -f -y datavg -s 128 -V 100 hdisk2 hdisk5
(-f is required to force creation of NEW VG on already defined defected VG, -V is optional, in my case it was a cluster, so I needed specific MajorNumber for this VG.)

To check MajorNumber of VG use command:
# ls -la /dev/datavg
crw-rw---- 1 root system 100, 0 May 04 05:10 /dev/datavg

Step 4. Recreate all LV's from map file

# mklv -y lvexphome -L /export/home -m lvexphome.map -t jfs2 datavg 4
# mklv -y lvmqhadata -L /MQHA/XZ0T0021/data -m lvmqhadata.map -t jfs2 datavg 40
# mklv -y lvmqhalog -L /MQHA/XZ0T0021/log -m lvmqhalog.map -t jfs2 datavg 8
# mklv -y lvoraexe -L /oraexe -m lvoraexe.map -t jfs2 datavg 96
# mklv -y lvora -L /oracle/ORACCVP -m lvora.map -t jfs2 datavg 8
# mklv -y lvoraarch -L /oracle/ORACCVP/arch -m lvoraarch.map -t jfs2 datavg 8
# mklv -y lvoraarchzip -L /oracle/ORACCVP/archzip -m lvoraarchzip.map -t jfs2 datavg 24
# mklv -y lvorabkp -L /oracle/ORACCVP/backup -m lvorabkp.map -t jfs2 datavg 96
# mklv -y lvoradat -L /oracle/ORACCVP/dat1 -m lvoradat.map -t jfs2 datavg 440
# mklv -y lvwwwexe -L /wwwexe -m lvwwwexe.map -t jfs2 datavg 40
# mklv -y lvwwwapp -L /wwwapp -m lvwwwapp.map -t jfs2 datavg 96
# mklv -y lvmaestro -L /opt/maestro -m lvmaestro.map -t jfs2 datavg 12
# mklv -y loglv00 -m loglv00.map -t jfs2log datavg 1
# mklv -y lvoraexp -L /oracle/ORACCVP/export -m lvoraexp.map -t jfs2 datavg 64

Step 5. Write JFS2 loging method as INLINE to LV control block of every LV (thanks IBM for this command)

# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvmqhadata
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvmqhalog
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvoraexe
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvora
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvoraarch
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvoraarchzip
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvorabkp
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvoradat
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvwwwexe
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvwwwapp
# putlvcb -f "vfs=jfs2:log=INLINE:options=rw:account=false" lvoraexp

Step 6. (optional) Import FS's from datavg to /etc/filesystems
If you don't have a backup of /etc/filesystems use this command to add all FS from datavg.
(all entries from datavg are removed when you run "exportvg datavg" command)

# imfs datavg
(after this command I notice that FS are imported to /etc/filesystem, BUT logging method is not set. I have to fill log = INLINE for every FS from datavg by my hand.)

Step 7. Verify if datavg has been recreated successfuly.

# lsvg -l datavg
datavg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
lvexphome jfs2 4 4 1 closed/syncd /export/home
lvmqhadata jfs2 40 40 1 closed/syncd /MQHA/XZ0T0021/data
lvmqhalog jfs2 8 8 1 closed/syncd /MQHA/XZ0T0021/log
lvoraexe jfs2 96 96 2 closed/syncd /oraexe
lvora jfs2 8 8 1 closed/syncd /oracle/ORACCVP
lvoraarch jfs2 8 8 1 closed/syncd /oracle/ORACCVP/arch
lvoraarchzip jfs2 24 24 1 closed/syncd /oracle/ORACCVP/archzip
lvorabkp jfs2 96 96 1 closed/syncd /oracle/ORACCVP/backup
lvoradat jfs2 440 440 2 closed/syncd /oracle/ORACCVP/dat1
lvwwwexe jfs2 40 40 1 closed/syncd /wwwexe
lvwwwapp jfs2 96 96 2 closed/syncd /wwwapp
lvmaestro jfs2 12 12 1 closed/syncd /opt/maestro
loglv00 jfs2log 1 1 1 closed/syncd N/A
lvoraexp jfs2 64 64 1 closed/syncd /oracle/ORACCVP/export

# mount -a
node mounted mounted over vfs date options
-------- --------------- --------------- ------ ------------ ---------------
/dev/hd4 / jfs2 May 04 05:59 rw,log=/dev/hd8
/dev/hd2 /usr jfs2 May 04 05:59 rw,log=/dev/hd8
/dev/hd9var /var jfs2 May 04 05:59 rw,log=/dev/hd8
/dev/hd3 /tmp jfs2 May 04 05:59 rw,log=/dev/hd8
/dev/hd1 /home jfs2 May 04 06:00 rw,log=/dev/hd8
/proc /proc procfs May 04 06:00 rw
/dev/hd10opt /opt jfs2 May 04 06:00 rw,log=/dev/hd8
/dev/lvmonlogs /mon/logs jfs2 May 04 06:00 rw,log=INLINE
/dev/lvtivoli /usr/local/Tivoli jfs2 May 04 06:00 rw,log=INLINE
/dev/lvmqm /usr/mqm jfs2 May 04 06:00 rw,log=/dev/hd8
/dev/lvmqhadata /MQHA/XZ0T0021/data jfs2 May 04 06:04 rw,log=INLINE
/dev/lvmqhalog /MQHA/XZ0T0021/log jfs2 May 04 06:04 rw,log=INLINE
/dev/lvexphome /export/home jfs2 May 04 06:04 rw,log=/dev/loglv00
/dev/lvmaestro /opt/maestro jfs2 May 04 06:04 rw,log=/dev/loglv00
/dev/lvora /oracle/ORACCVP jfs2 May 04 06:04 rw,log=INLINE
/dev/lvoraarch /oracle/ORACCVP/arch jfs2 May 04 06:04 rw,log=INLINE
/dev/lvoraarchzip /oracle/ORACCVP/archzip jfs2 May 04 06:04 rw,log=INLINE
/dev/lvorabkp /oracle/ORACCVP/backup jfs2 May 04 06:04 rw,log=INLINE
/dev/lvoradat /oracle/ORACCVP/dat1 jfs2 May 04 06:04 rw,log=INLINE
/dev/lvoraexp /oracle/ORACCVP/export jfs2 May 04 06:04 rw,log=INLINE
/dev/lvoraexe /oraexe jfs2 May 04 06:04 rw,log=INLINE
/dev/lvwwwapp /wwwapp jfs2 May 04 06:04 rw,log=INLINE
/dev/lvwwwexe /wwwexe jfs2 May 04 06:04 rw,log=INLINE

Enjoy! :-)