venerdì 25 novembre 2011

Cannot boot OpenSuse 12 after cloning disk due to by-id access to the disk

Hi all,
today I tried to clone a pc with OpenSuse12 using Clonezilla as cloning solution.
Then I tried to boot the target cloned machine but it wasn't able to boot and the errors was something like this (the disk names are from another post, just as an example) :



Trying manual resume from /dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1
resume device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1 not found (ignoring)
Trying manual resume from /dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1
resume device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1 not found (ignoring)
Waiting for device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 to appear : ........................ Could not find dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 .
Want me to fall back to dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 ? (Y/N)
y
Waiting for device dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2 to appear : ...............not found -- exiting to /bin/sh




The typical messages are:

Trying manual resume from
resume device dev/disk/by-id/ata-...-part1 not found (ignoring)
Waiting for device dev/disk/by-id/ata-...-part2 to appear
Could not find dev/disk/by-id/ata-...-part2
Want me to fall back to dev/disk/by-id/ata-...-part2 ? (Y/N)


This happens due to a new default setting in OpenSuse: from Ver.10Sp1 on, the new default is to reference the storage device (the disks)  "by-id" instead of by-name

I mean, in the past the disks was referenced like this:
sda
sdb
...


then the partitions of the first disk (sda) was:
sda1
sda2
sda3


and so on.

Now the new way to reference disk and partition is:

The disks are (just an example, it changes based on the disk manifacturer and other data):
/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8

where the first row is the first disk, a Toshiba disk, the second is another disk, a Seagate disk.

The partitions will be, for the first disk, for example:

/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1
/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part2

for the second disk:
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part1
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2

The problem with cloning is that around the system, in some configuration files, there are references to the original disks "by-id", unfortunately on the target computer (where we restore the image) the disks will be different, will have different "by-id" name, so linux will be unable to find the disks and boot correctly.

SOLUTION


The solution is quite simple.
After creating the MASTER computer, we need to change 2 files in order to modify the "by-id" reference in "by-name" reference.
The files are:


/etc/fstab
/boot/grub/menu.lst


in both the files we need to find every instance of names like (example)

/dev/disk/by-id/ata-TOSHIBA-MK1246GSX-28FGTI70T-part1

and change in something like:

/dev/sda1

take care about the partition number:
-part1  ->  sda1
-part2  ->  sda2

and so on.

To modify those files from a command prompt we need to run the editor using sudo else we will get an error (missing rights):

sudo vi /etc/fstab


(then i to go into insert mode, change the disk name, then press ESC to exit insert mode, then :wq to write the changes to disk and quit, else to discard changes :qa!)

sudo vi /boot/grub/menu.lst


(same instruction as above)

Reboot the computer to check that everything is still working fine.
You are now ready to create the image with Clonezilla (or other cloning solution) and restore on the target pc.


SAMPLE
Here how my files appeared before and after the change:

/etc/fstab
BEFORE


/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part1 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part3 /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0


/etc/fstab
AFTER


/dev/sda1 swap                 swap       defaults              0 0
/dev/sda2 /                    ext4       acl,user_xattr        1 1
/dev/sda3 /home                ext4       acl,user_xattr        1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0



/boot/grub/menu.lst
BEFORE




# Modified by YaST2. Last modification on Fri Nov 25 21:23:32 CET 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader


default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2 resume=/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part1 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/disk/by-id/ata-ST380013AS_4MR2NSD8-part2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default


/boot/grub/menu.lst
AFTER


# Modified by YaST2. Last modification on Fri Nov 25 21:23:32 CET 2011
# THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader
# For the new kernel it try to figure out old parameters. In case we are not able to recognize it (e.g. change of flavor or strange install order ) it it use as fallback installation parameters from /etc/sysconfig/bootloader


default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/boot/message
##YaST - activate


###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/sda2 resume=/dev/sda1 splash=silent quiet showopts vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default


###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 12.1 - 3.1.0-1.2
    root (hd0,1)
    kernel /boot/vmlinuz-3.1.0-1.2-default root=/dev/sda2 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 nomodeset x11failsafe vga=0x31a
    initrd /boot/initrd-3.1.0-1.2-default



bye
Digger



giovedì 17 novembre 2011

Chrome - disable or remove plugins (Orbit downloader for example)

Hi all,
it happened to me to notice that after uninstalling Orbit downloader, google Chrome still tried to use Orbit to download files, obviously without success.

So there are 2 things you can do now:
1. disable the plugin
2. delete the plugin

The instructions are for Orbit, but the same is valid for every plugin.

== DISABLE PLUGINS ==


in the address bar write:

chrome://plugins


search for Orbit downloader and click on "Disable"

== DELETE PLUGINS ==


FIRST close Chrome!

from the start menu execute:

%localappdata%


to go in the local application data folder
(something like: C:\Users\username\AppData\Local)

then go to the subfolder

Google\Chrome\Application\Plugins


search for the plugin's .dll file  (in this case, for Orbit it's "nporbit.dll") and delete it.
Open Chrome, the plugin disappeared

bye
Digger

lunedì 24 ottobre 2011

Windows Live Messenger error 0x81000306

Hi all,
after days of headache trying to solve this stupid error about messenger on my pc I finally found the solution working for me and it was simply this:

run the command prompt (cmd) with administrative rights
type and confirm this command:

netsh interface tcp set global autotuninglevel=disabled 


and it started immediately to work!


hope this could help someone else


bye
Digger

lunedì 10 ottobre 2011

Server uptime - Last Boot time

Hi all,
I would like to share with you this nice and useful command from the console to retrieve the local/remote system last boot time.
It's useful for example to calculate the uptime of a remote server


wmic /node:"servername" os get lastbootuptime

to retrive the local boottime simply don't use the /node option

bye

venerdì 29 luglio 2011

Remotely register DLL libraries

Hi all,
we have an application here around the network in quite all the clients that stops working when we deploy Office2010 as a dll file got missing on the client itself.

The fastest solution is to copy the dll back and to register it again.

If you want to do it remotely, and I don't mean with remote desktop, you can do it like this:

Prerequisites:
- You are logged on your pc with a user with admin rights on the target machine
- you already downloaded PSTOOLS from here:
http://technet.microsoft.com/it-it/sysinternals/bb897553.aspx

and have psexec command ready to be run on the disk

(I've already remotely copied the dll file to the c:\windows\system32 on the target machine)

1. open the command prompt
2. change to the psexec directory
3. submit this command:

psexec \\pcname cmd

A command prompt appears on your pc, but it is executing on the target machine (named pcname) !

submit the command to register the dll, but silently because we don't want any message on the target (message that the user will not see anyway as we are executing in a different context):

regsvr32 /s mylibrary.dll

/s  is for "silent"
mylibrary.dll is the .dll to be registered

type

exit

to close the remote command prompt and then exit again to close local prompt

that's all, the application is now  working again :)

P.S: I used it logged on my pc with a user with admin rights on the target, but if you are not, you could try it with the switches:

-u user -p password

that should do the job (not tried)

bye
Digger

martedì 26 luglio 2011

SCCM 2007 - Fill collection from text file (import machine names)

Hi all,
today I was trying to fill a collection in SCCM2007 importing the machines name from a text file I produced manually using Excel due to some manual work on them (filtering, manual check and so on).

I first tried to import them using the "right-click-tool-menu" on the collection itself.
At first it seems the right way to do it but then I noticed this introduced some strange behaviour in the collection as when you want to edit the collection (right click, properties) you notice that some entries are EMPTY!
So you don't know what you are going to remove...

Very bad..
So I tried other ways, also powershell scripts.
But I was not very satisfied.

So at the end I found my way, ok, not the best one probably, but it does the job.

The way is to create a query in the collection where you put the machine list like this:

select SMS_R_SYSTEM.ResourceID,SMS_R_SYSTEM.ResourceType,SMS_R_SYSTEM.Name,SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client from SMS_R_System  where  SMS_R_System.Name in   ( "PCNAME001" , "PCNAME002" , "PCNAME003" )

Ok, it works.
The problems now are two from my point of view.

1. it is a little bit boring to write the query manually putting all the machine names when I have it in excel and I could do a copy & paste
2. let's say in the future I need to modify the collection adding or removig some machine... not very easy to do

So I found my way also on this, 15 minutes and I wrote this small but useful application in VB.NET:







I write (paste) the machine list on the left, click the upper button and I obtain the query to paste in SCCM.
If I have to modify an existing collection, I copy and paste the query from SCCM to the right textbox and click the bottom button and on the leftI obtain the machine list, then I can edit it adding and removing, click the upper button again and I have the new query to pase in SCCM

For sure there are other tools/ways around, but for what I have to do, this is a good solution for me :)

bye
Digger



venerdì 10 giugno 2011

Windows Update non funziona, errore 0x8DDD0018

Ciao,
oggi ho perso un sacco di tempo per risolvere questo problema, magari questo post potrebbe risparmiarne un po' a qualcun altro...

Seguendo i consigli di Microsoft ho controllato i servizi BITS, Aggiornamenti automatici, Registro eventi etc, ma purtroppo erano tutti correttamente avviati.
Nel log degli eventi e in quello degli updates non c'erano indicazioni su quale fosse il vero problema, allora alla fine l'unica cosa che mi ha salvato è stato di REINSTALLARE windows update.

Premetto che la procedura potrebbe chiedervi di inserire il cd con la service pack, quindi nel caso il vostro sistema operativo sia servicepakkato vi consiglio di assicurarvi che i files siano ancora sul pc, oppure in alternativa procuratevi la servicepack, oppure il cd con la service pack in modo da avere il tutto a disposizione durante lo step successivo.

Per reinstallare windows update fate cosi:

1. aprite il prompt (esegui, CMD, invio)
2. digitate questo comando e date invio:

%windir%\System32\rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 %windir%\inf\au.inf


3. a questo punto potrebbe chiedervi i famosi files della service pack, fatelo puntare a dove li avete salvati
4. riavviate il pc
5. aprite IE e provate ad andare sul sito di windows update

Se tutto va bene dovrebbe funzionare

ciao