Hints and tips on os

These are some helpful hints on various topics.

 

Copy Volume serial number of a disk

When you make a copy of a disk using Copy Disk you get identical clone, except for a small detail: Volume serial number.

Volume serial number

There are some anti-copy protections based on this. Here is how to change this number under Linux:

Using mdir tool from package mtools you can see the serial number of the original disk, for example 173c-10db
Put the copied disk into the flopy device and save its volume serial number to the file  floppy.vsn using this command:
    dd if=/dev/floppy bs=1 count=4 skip=39  > floppy.vsn
Edit this file with some hex editor for example hexedit, and put the original number in it. You should be careful - bytes are copied backwards. So if you want to write number 173c-10db, you should type db 10 3c 17 into this file.
Save the number back to the copy:
    dd of=/dev/floppy bs=1 count=4 skip=39  < floppy.vsn


Mounting Windows shared folder in Linux

We have Windows resource under \\otherhost\share which we want to to see on the Linux machine as /mnt/winshare. Windows credentials are user/pass. So we use:

mkdir /mnt/winshare

mount -t smbfs -o username=user,password="pass" //otherhost/share /hmnt/winshare

or

mount -t cifs -o username=user,password="pass" //otherhost/share /hmnt/winshare