dimanche 28 août 2016

How to recover from Lenovo partition when F11 key is not working and Rescue and Recovery crash at installation with Error code 6

How to recover from Lenovo partition when F11 key is not working and Rescue and Recovery crash at installation with Error code 6 :


1/ First follow the steps to create a WinPE bootable usb: http://technet.microsoft.com/en-us/library/dd744530(WS.10).aspx (install Windows AIK ).

2/ Make sure you do step 2 (imageX).

Note :  You have to mount WinPEimage then include imagex in windows/system32 folder then commit and unmount (important step!) :

Where e: is the letter for the USB stick

ImageX for 64bit systems is located in the ‘amd64’ folder, so we will open it. Next, we will use ImageX command with /mountrw switch. /mountrw will make our mount readable and writable. We will also choose our winpe.wim file, boot the first installation in it (option 1), and choose our output folder (c:\winpe). The final command looks like this: imagex /mountrw e:\usb_stick_folder\winpe.wim 1 c:\winpe.
Mounting Process
The content from the e:\usb_stick_folder\ folder was mounted to the c:\winpe folder. When the mount is complete we can browse to the c:\wpem folder and see the content of the image.

 Winpe Folder
Now we have to copy ImageX from the ‘C:\Program Files\Windows AIK\Tools\amd64‘ folder to our ‘c:\winpe’ folder.

ImageX Copied
Now we can unmount the image and commit changes. Remember that we can also copy other data, tools, drivers or anything else that we want to have available once we boot up with that WinPE image. To unmount the image let’s go to the command prompt and run the following command: imagex /unmount /commit c:\winpe.
Try to boot the usb stick and if successful you should be able to use imageX command.

use diskpart to recreate the partitions S and C (do not erase Q (lenovo_recovery) !!!). the partition specs such as size, type, label, letter, active, are found in file 'recovery.ini' hidden on Q (print it out or use another computer). example of diskpart usage:

diskpart

list disk
select disk 0

list partition
select partition 1
delete partition

select partition 2
delete partition

create partition primary size=1199
select partition 1
active
format fs=ntfs label="SYSTEM_DRV" quick
assign letter=s

create partition primary
select partition 2
format fs=ntfs label="Windows7_OS" quick
assign letter=c

exit
--
(the above is only an example, see your 'recovery.ini' in (recovery partition) file for correct settings.)
to recover S and C from wim files with imagex use these two commands:
imagex.exe /apply /verify Q:\factoryrecovery\Sdrivebackup.wim 1 S:\
imagex.exe /apply /verify Q:\factoryrecovery\Cdrivebackup.swm 1 C:\ /ref Q:\factoryrecovery\Cdrivebackup*.swm 
 /ref give the possibility to copy a split image (split image = multiple .swm files!)
Now reboot into a windows dvd or windows repair disk. Repair startup (should be automatic). reboot into windows and that 's it !
I tested it sucessfully on 2016 August on a Lenovo T430s laptop.

Addendum (recovery.ini sample) :

DO NOT ERASE LENOVO RECOVERY PARTITION

[partition1]
size=13999
type=07
label=Lenovo_Recovery
volume=Q
fs=NTFS
active=0
backuptype=COPY
state=1
recfromsp=0
imagename=
install=
installsplit=

[partition2]
size=1499
type=07
label=SYSTEM_DRV
volume=S
fs=NTFS
active=1
backuptype=WIM
state=1
recfromsp=0
imagename=Sdrivebackup.wim
install=recimagex.exe /apply /verify Q:\factoryrecovery\Sdrivebackup.wim 1 S:\
installsplit=recimagex.exe /apply /verify Q:\factoryrecovery\Sdrivebackup.swm 1 S:\ /ref Q:\factoryrecovery\Sdrivebackup*.swm

[partition3]
size=
type=07
label=Windows7_OS
volume=C
fs=NTFS
active=0
backuptype=WIM
state=1
recfromsp=0
imagename=Cdrivebackup.wim
install=recimagex.exe /apply /verify Q:\factoryrecovery\Cdrivebackup.wim 1 C:\
installsplit=recimagex.exe /apply /verify Q:\factoryrecovery\Cdrivebackup.swm 1 C:\ /ref Q:\factoryrecovery\Cdrivebackup*.swm

mardi 30 décembre 2014

Cpanel useful scripting

Cpanel useful scripting


  •  List true user domains and redirect to /tmp/log-mail.txt file

#!/bin/bash

list_domain=`cat /etc/trueuserdomains | cut -d : -f2`

for user in $list_domain
do
        echo $user
        du -ch /home/$user/mail >> /tmp/log-mail.txt
done



  • Print big user usage like n.n Gigs or nn Gigs

cat /tmp/log-mail.txt | egrep '(^[0-9].[0-9]G|^[0-9][0-9]G)'

  • Print usage by email account for a user
 
du -ch --max-depth=1 /home/userdomain/mail/domain.com

mardi 14 février 2012

Websphere Application Server v7 - rename node

Firstly,
cd into /opt/IBM/wasnd/profiles/instancename/bin
./renameNode.sh [dmgr] [SOAP port] [new name]

For obscure reasons, I had errors restarting the node agent...So my fix was to checks the logs and I found that I must copy manually file "node-metadata.properties" from dmgr profile to remote node , in instance profile.

for example:
1) machine A
/opt/IBM/websphere/AppServer/V7R0/wasnd/profiles/Dmgr01/config/cells/company_cell/nodes/wcsmachineB_node/node-metadata.properties

to

2) machine B
/opt/IBM/websphere/AppServer/V7R0/wasnd/profiles/wcsb2cprd/config/cells/company_cell/nodes/wcsmachineB_node

(in red, it is personalized folders)