Cyberoam Iview adalah software Intelligent Logging dan Reporting. Software ini bersifat open source dan dapat kita download dan gunakan gratis tanpa membayar lisensi, fitur software ini sangat bagus dimana banyak software sejenis lainnya di develop secara lisensi. Cyberoam iView merupakan keluaran terbaru setelah perusahaan Cyberoam mengeluarkan devices untuk network security dan router. Traffic pemakaian setiap user dapat kita monitor melalui iView, Devices dan software Cyberiam sangat cocok bagi internet service provider dimana dapat menempatkan router cyberoam di clientnya dan memberikan user login ke usernya melalui server iView untuk dapat melihat dan memantau aktifitas internet user tersebut. Software ini dapat saya katakan gabungan dari beberapa software lain seperti Untangle, Cacti, SARG, Bandwidth Management, QOS, Filtering,dan sebagainya.
Instalasi software versi Linux Cyberoam-iView agak sulit tetapi dengan waktu yang cukup akhirnya saya berhasil menginstall software ini dan memasukkan puluhan cyberoam devices ke dalam server ini untuk dapat dimonitor dan diberikan ke client. Bagaimana proses instalasi dan konfigurasinya ?
Saya menggunakan iView-Linux-0.111, sistem operasi Debian GNU Linux 5.0.8 Lenny, PostgreSQL 8.4, Java 1.5 untuk server menggunakan Supermicro Computer, Inc dengan memory 2 GB
Pastikan sistem operasi debian sudah di install dengan standart system, tanpa GUI, biar lite dan ringan.
PRI-IVIEW1:/home/gtoms# cat /etc/debian_version
5.0.8
PRI-IVIEW1:/home/gtoms# uname -a
Linux NGLAEM1 2.6.26-2-686 #1 SMP Thu Jan 27 00:28:05 UTC 2011 i686 GNU/Linux
apt-get install syslog-ng
vi /etc/syslog-ng/syslog-ng.conf
options {
long_hostnames(off);
sync(0);
stats(43200);
dns_cache(yes);
use_fqdn(no);
keep_hostname(yes);
use_dns(yes);
};
source gateway {
unix-stream("/dev/log");
internal();
udp(ip(0.0.0.0) port(514));
};
source tcpgateway {
unix-stream("/dev/log");
internal();
tcp(ip(0.0.0.0) port(514) max_connections(1000));
};
destination hosts {
file("/var/log/syslog-ng/$HOST/$FACILITY"
owner(root) group(root) perm(0600) dir_perm(0700)
create_dirs(yes));
};
log {
source(gateway); destination(hosts);
};
log {
source(tcpgateway); destination(hosts);
};
/etc/init.d/syslog-ng restart
Untuk memudahkan instalasi PostgreSQL 8.4 saya edit sources.list :
PRI-IVIEW1:~# apt-get install postgresql
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdb4.8 libexpat1 libpq5 libssl0.9.8 lsb-release openssl
openssl-blacklist php5-common php5-pgsql postgresql-client-8.4 postgresql-client-common postgresql-common postgresql-doc postgresql-doc-8.4 ssl-cert
Suggested packages:
lsb ca-certificates postgresql slony1-bin oidentd ident-server
The following NEW packages will be installed:
libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libdb4.8 libexpat1 lsb-release openssl openssl-blacklist
php5-common php5-pgsql postgresql-8.4 postgresql-client-8.4 postgresql-client-common postgresql-common postgresql-doc postgresql-doc-8.4 ssl-cert
The following packages will be upgraded:
libpq5 libssl0.9.8
2 upgraded, 24 newly installed, 0 to remove and 30 not upgraded.
Need to get 26.0MB of archives.
After this operation, 66.8MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org lenny/updates/main php5-common 5.2.6.dfsg.1-1+lenny10 [366kB]
Get:2 http://backports.debian.org lenny-backports/main libssl0.9.8 0.9.8o-4~bpo50+1 [3063kB]
Get:3 http://ftp.us.debian.org lenny/main openssl-blacklist 0.4.2 [6338kB]
Get:4 http://security.debian.org lenny/updates/main libapache2-mod-php5 5.2.6.dfsg.1-1+lenny10 [2485kB]
12% [2 libssl0.9.8 1910056/3063kB 62%] [3 openssl-blacklist 786029/6338kB 12%] [4 libapache2-mod-php5 213989/2485kB 8%]———————————skip————————————————————-
Enabling site default.
Enabling module alias.
Enabling module autoindex.
Enabling module dir.
Enabling module env.
Enabling module mime.
Enabling module negotiation.
Enabling module setenvif.
Enabling module status.
Enabling module auth_basic.
Enabling module deflate.
Enabling module authz_default.
Enabling module authz_user.
Enabling module authz_groupfile.
Enabling module authn_file.
Enabling module authz_host.
Enabling module reqtimeout.
Setting up libpq5 (8.4.7-0squeeze1~bpo50+1) ...
Setting up php5-pgsql (5.2.6.dfsg.1-1+lenny10) ...
Setting up postgresql-client-common (111~bpo50+1) ...
Setting up postgresql-client-8.4 (8.4.7-0squeeze1~bpo50+1) ...
Setting up ssl-cert (1.0.23) ...
Setting up postgresql-common (111~bpo50+1) ...
Adding user postgres to group ssl-cert
Building PostgreSQL dictionaries from installed myspell/hunspell packages…
Setting up postgresql-8.4 (8.4.7-0squeeze1~bpo50+1) ...
Creating new cluster (configuration: /etc/postgresql/8.4/main, data: /var/lib/postgresql/8.4/main)...
Moving configuration file /var/lib/postgresql/8.4/main/postgresql.conf to /etc/postgresql/8.4/main…
Moving configuration file /var/lib/postgresql/8.4/main/pg_hba.conf to /etc/postgresql/8.4/main…
Moving configuration file /var/lib/postgresql/8.4/main/pg_ident.conf to /etc/postgresql/8.4/main…
Configuring postgresql.conf to use port 5432…
Starting PostgreSQL 8.4 database server: main.
Setting up postgresql-doc-8.4 (8.4.7-0squeeze1~bpo50+1) ...
Setting up postgresql-doc (8.4.7-0squeeze1~bpo50+1) ...
Setting up lsb-release (3.2-20) ...
PRI-IVIEW1:~# ln -s /etc/init.d/postgresql /etc/init.d/postgresql-8.4
PRI-IVIEW1:~# ln -s /var/lib/postgresql/8.4/main /var/lib/postgresql/8.4/main/data
PRI-IVIEW1:~#
PRI-IVIEW1:~# mkdir /iviewdb/
PRI-IVIEW1:~# chown -R postgres.postgres /iviewdb
postgres@PRI-IVIEW1:/root$
PRI-IVIEW1:~# su postgres
postgres@PRI-IVIEW1:/root$ /usr/lib/postgresql/8.4/bin/initdb -D /iviewdb
The files belonging to this database system will be owned by user “postgres”.
This user must also own the server process.
The database cluster will be initialized with locale en_NG.
The default database encoding has accordingly been set to UTF8.
The default text search configuration will be set to “english”.
fixing permissions on existing directory /iviewdb … ok
creating subdirectories … ok
selecting default max_connections … 100
selecting default shared_buffers … 28MB
creating configuration files … ok
creating template1 database in /iviewdb/base/1 … ok
initializing pg_authid … ok
initializing dependencies … ok
creating system views … ok
loading system objects’ descriptions … ok
creating conversions … ok
creating dictionaries … ok
setting privileges on built-in objects … ok
creating information schema … ok
vacuuming database template1 … ok
copying template1 to template0 … ok
copying template1 to postgres … ok
WARNING: enabling “trust” authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.
Success. You can now start the database server using:
/usr/lib/postgresql/8.4/bin/postgres -D /iviewdb
or
/usr/lib/postgresql/8.4/bin/pg_ctl -D /iviewdb -l logfile start
postgres@PRI-IVIEW1:/root$ createuser pguser
Shall the new role be a superuser? (y/n) y
postgres@PRI-IVIEW1:/root$ psql postgres
psql (8.4.7)
Type “help” for help.
postgres=# template1=# \password pguser;
Enter new password:
Enter it again:
postgres-# \q
postgres@PRI-IVIEW1:/root$ exit
exit
PRI-IVIEW1:/etc/postgresql/8.4/main# su – postgres
postgres@PRI-IVIEW1:~$ createdb iviewdb;
postgres@PRI-IVIEW1:~$ psql -c -d template1
postgres:~$ ALTER USER postgres WITH PASSWORD 'passworddb';
postgres@PRI-IVIEW1:~$ exit
PRI-IVIEW1:~# cd /etc/postgresql/8.4/main
PRI-IVIEW1:/etc/postgresql/8.4/main# ls
environment pg_ctl.conf pg_hba.conf pg_ident.conf postgresql.conf start.conf
PRI-IVIEW1:/etc/postgresql/8.4/main# mkdir data
PRI-IVIEW1:/iviewdb#chmod 777 /etc/postgresql/8.4/main/data
PRI-IVIEW1:/iviewdb#chmod 777 /var/lib/postgresql/8.4/main/data
PRI-IVIEW1:/iviewdb# cp /var/lib/postgresql/8.4/main/PG_VERSION /etc/postgresql/8.4/main/data
PRI-IVIEW1:/iviewdb#cp /var/lib/postgresql/8.4/main/PG_VERSION /var/lib/postgresql/8.4/main/data/
PRI-IVIEW1:/home/gtoms# nano /etc/postgresql/8.4/main/pg_hba.conf
Database administrative login by UNIX sockets
local all postgres trust
TYPE DATABASE USER CIDR-ADDRESS METHOD
“local” is for Unix domain socket connections only
local all all trust
IPv4 local connections:
host all all 127.0.0.1/32 trust
IPv6 local connections:
host all all ::1/128 trust
/etc/init.d/postgresql restart
Selesai menginstall PostgreSQL 8.4 saya menginstall JAVA 1.5 sesuai syarat iView agar bisa berjalan, edit kembali sources.list untuk dapat mencari paket instalasi Java 1.5 :
nano /etc/apt/sources.list
deb http://ftp.us.debian.org/debian/ lenny main non-free
deb-src http://ftp.us.debian.org/debian/ lenny main non-free
deb http://security.debian.org/ lenny/updates main non-free
deb-src http://security.debian.org/ lenny/updates main non-free
PRI-IVIEW1:/home/gtoms# apt-get install openjdk-6-jdk openjdk-6-jre
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
avahi-daemon dbus dbus-x11 defoma gsfonts gsfonts-x11 java-common libasound2 libavahi-common-data libavahi-common3 libavahi-core5 libdaemon0 libdbus-1-3 libfontenc1 libfreetype6 libice6 libltdl3
libnss-mdns libsm6 libxfont1 libxi6 libxt6 libxtst6 odbcinst1debian1 sun-java5-bin sun-java5-demo sun-java5-jre unixodbc xfonts-encodings xfonts-utils
Suggested packages:
avahi-autoipd defoma-doc dfontmgr psfontmgr x-ttcidfont-conf equivs libasound2-plugins libfreetype6-dev sun-java5-doc sun-java5-source sun-java5-plugin ia32-sun-java5-plugin sun-java5-fonts ttf-baekmuk
ttf-unfonts ttf-unfonts-core ttf-kochi-gothic ttf-sazanami-gothic ttf-kochi-mincho ttf-sazanami-mincho ttf-arphic-uming libmyodbc odbc-postgresql libct1
Recommended packages:
libft-perl
The following NEW packages will be installed:
avahi-daemon dbus dbus-x11 defoma gsfonts gsfonts-x11 java-common libasound2 libavahi-common-data libavahi-common3 libavahi-core5 libdaemon0 libdbus-1-3 libfontenc1 libfreetype6 libice6 libltdl3
libnss-mdns libsm6 libxfont1 libxi6 libxt6 libxtst6 odbcinst1debian1 sun-java5-bin sun-java5-demo sun-java5-jdk sun-java5-jre unixodbc xfonts-encodings xfonts-utils
0 upgraded, 31 newly installed, 0 to remove and 0 not upgraded.
Need to get 51.8MB of archives.
After this operation, 130MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://security.debian.org lenny/updates/main libavahi-common-data 0.6.23-3lenny3 [31.4kB]
Get:2 http://ftp.us.debian.org lenny/main libice6 2:1.0.4-1 [46.6kB]
Get:3 http://security.debian.org lenny/updates/main libavahi-common3 0.6.23-3lenny3 [48.0kB]
Get:4 http://security.debian.org lenny/updates/main libavahi-core5 0.6.23-3lenny3 [115kB]
Get:5 http://ftp.us.debian.org lenny/main libsm6 2:1.0.3-2 [22.3kB]
———————————————-skip——————————————————————-
Selesai instalasi Java 1.5 tiba saatnya menginstall iView, download iView di :
http://sourceforge.net/projects/cyberoam-iview/files/
PRI-IVIEW1:/home/gtoms#mkdir /iview
PRI-IVIEW1:/home/gtoms#mkdir /iview/archive
PRI-IVIEW1:/home/gtoms#chmod 755 iView-Linux-0.111-Setup.bin
PRI-IVIEW1:/home/gtoms# ./iView-Linux-0.111-Setup.bin
Enter Directory path to install iView
: /iview
Enter Directory path to store archived logs
: /iview/archive
Path values
IVIEW_HOME:/iview
ARCHIVE_HOME:/iview/archive
Checking kernel version compatibility …Done
Enter Postgresql 8.4 Home directory path
(Absolute path of directory that contains PostgreSQL data folder)
:/var/lib/postgresql/8.4/main/
Checking PG_version (PG 8.4 is required)...Done
searching psql client…Done
Enter JAVA 1.5 Home path
:/usr/lib/jvm/java-6-openjdk
Setting up JAVA for Cyberoam-iView (jdk 1.5 or greater is required)Java…Done
Creating IVIEW_HOME directory…Done
Copying GUI files…Done
Copying system files…Done
Updating PostgreSQL database parameters according to hardware configuration…Done
Setup starting service postgre
./iview_linux_installer/setup: line 373: /etc/init.d/postgresql-8.4: No such file or directory
please wait creating database
25%
50%
75%
100%...Done
Updating Cyberoam-iView parameters in database…Done
Specify password for default Cyberoam-iView administrator â “admin”
Administrator Username is: admin
Specify Password:
Re-enter Password:
Administrator’s Email id
henry@gultom.or.id
Registering Cyberoam-iView as a service…Done
Starting iviewd service
PRI-IVIEW1:/home/gtoms#
Ada error /etc/init.d/postgresql-8.4: No such file or directory tidak masalah, kita bisa merestart kembali dengan #/etc/init.d/postgresql restart
Cek status iview :
NGLAEM1:/home/gtoms# /etc/init.d/iviewd status
iView Web application is Running
iView Syslog server is Running
Kita bisa login ke webase iView :
http;//hostnameip:8000
środa, 26 października 2011
Install Postgres-8.4 Debian 6
apt-get update
apt-get install debian-backports-keyring
apt-get install -t lenny-backports postgresql-8.4 phppgadmin
You'll notice that I've added phppgadmin (a Php written frontend for the DB, somewhat similar to the mysql one), remove it in case you didn't need it or hadn't Apache installed).
Let's go on with the shell! (commented lines will briefly explain what happens)
#let's stop the main daemon to avoid mess
/etc/init.d/postgresql-8.4 stop
# now let's login as the postgres user (in order to start interacting with the db)
# By default uses the same pwd as root, maybe better changing it (for clarity I'll add postgres$ before the commands)
su postgres
# this command will allow us to initiate a new database in a custom location (/my/db/path/ has to be replaced with your personal one)
postgres$ /usr/lib/postgresql/8.4/bin/initdb -D /my/db/path/
# once created our shiny new base, let's create a user to start using it (give it admin rights when prompted)
postgres$ createuser pguser
# let's change the new user's password. psql command connects to the new db and allows to manage it
postgres$ psql postgres
# once logged into the db use this command to change new user's passphrase
template1=# \password pguser;
template1=# \q
#let's get back to our root
postgres$ exit
#this passage is fundamental to get things working, it links our custom db's conf to the one the daemon will read
ln -s /my/db/path/postgresql.conf /etc/postgresql/8.4/main/postgresql.conf
Don't forget to replace ConfigDir with your personal one, on /my/db/path/postgresql.conf
Now, in order to use Phppgadmin safely, we've to change the default security behavior (if not Phppgadmin will accept random passwords to login)
On our /my/db/path/pg_hba.conf we'll have to look for the last lines where the hosts are listed and change METHOD to md5 (default should be trust)
Let's finally start the DB
/etc/init.d/postgresql-8.4 start
apt-get install debian-backports-keyring
apt-get install -t lenny-backports postgresql-8.4 phppgadmin
You'll notice that I've added phppgadmin (a Php written frontend for the DB, somewhat similar to the mysql one), remove it in case you didn't need it or hadn't Apache installed).
Let's go on with the shell! (commented lines will briefly explain what happens)
#let's stop the main daemon to avoid mess
/etc/init.d/postgresql-8.4 stop
# now let's login as the postgres user (in order to start interacting with the db)
# By default uses the same pwd as root, maybe better changing it (for clarity I'll add postgres$ before the commands)
su postgres
# this command will allow us to initiate a new database in a custom location (/my/db/path/ has to be replaced with your personal one)
postgres$ /usr/lib/postgresql/8.4/bin/initdb -D /my/db/path/
# once created our shiny new base, let's create a user to start using it (give it admin rights when prompted)
postgres$ createuser pguser
# let's change the new user's password. psql command connects to the new db and allows to manage it
postgres$ psql postgres
# once logged into the db use this command to change new user's passphrase
template1=# \password pguser;
template1=# \q
#let's get back to our root
postgres$ exit
#this passage is fundamental to get things working, it links our custom db's conf to the one the daemon will read
ln -s /my/db/path/postgresql.conf /etc/postgresql/8.4/main/postgresql.conf
Don't forget to replace ConfigDir with your personal one, on /my/db/path/postgresql.conf
Now, in order to use Phppgadmin safely, we've to change the default security behavior (if not Phppgadmin will accept random passwords to login)
On our /my/db/path/pg_hba.conf we'll have to look for the last lines where the hosts are listed and change METHOD to md5 (default should be trust)
Let's finally start the DB
/etc/init.d/postgresql-8.4 start
poniedziałek, 24 października 2011
Convert *.vhd to *.vmdk
Winimage przynajmniej 8.5
Xenserver - export obraz maszyny
winimage 8.5 przekonwertowanie do vmdk
ESX tworzymy new VM tylko nie tworzymy nowego dysku tylko podpinamy istniejacy wysłany na macierz
Xenserver - export obraz maszyny
winimage 8.5 przekonwertowanie do vmdk
ESX tworzymy new VM tylko nie tworzymy nowego dysku tylko podpinamy istniejacy wysłany na macierz
czwartek, 20 października 2011
Vmtools i Xentools Debian 6
Vmware
echo deb http://debian.uchicago.edu/debian/ squeeze main contrib >> /etc/apt/sources.list
echo deb-src http://debian.uchicago.edu/debian/ squeeze main contrib >> /etc/apt/sources.list
apt-get update
apt-get install open-vm-tools open-vm-source
module-assistant auto-install open-vm -i
XenServer
apt-get install xen-tools
echo deb http://debian.uchicago.edu/debian/ squeeze main contrib >> /etc/apt/sources.list
echo deb-src http://debian.uchicago.edu/debian/ squeeze main contrib >> /etc/apt/sources.list
apt-get update
apt-get install open-vm-tools open-vm-source
module-assistant auto-install open-vm -i
XenServer
apt-get install xen-tools
I used this to install VMware tools to CentOS 6.2 on ESXi 4.1
Add VMware GPG keys:
rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-DSA-KEY.pub rpm --import http://packages.vmware.com/tools/keys/VMWARE-PACKAGING-GPG-RSA-KEY.pub
Edit /etc/yum.repos.d/vmware-tools.repo:
[vmware-tools] name=VMware Tools baseurl=http://packages.vmware.com/tools/esx/4.1latest/rhel6/$basearch enabled=1 gpgcheck=1
Install VMware Tools:
yum install vmware-open-vm-tools-nox
środa, 19 października 2011
VBS podstawy
http://msdn.microsoft.com/en-us/library/7w5tbs5z(v=VS.85).aspx
skrypt
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "\\fs\NETLOGON\dot4.exe"
WScript.Sleep 15000
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys " " <-- SPACE :)
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
skrypt
set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run "\\fs\NETLOGON\dot4.exe"
WScript.Sleep 15000
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys " " <-- SPACE :)
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{TAB}"
WScript.Sleep 500
WshShell.SendKeys "{ENTER}"
Debian gnome root
/etc/gdm3/daemon.conf:
[security]
AllowRoot=true
disable 5 line in /etc/pam.d/gdm3:
#%PAM-1.0
auth requisite pam_nologin.so
auth required pam_env.so readenv=1
auth required pam_env.so readenv=1 envfile=/etc/default/locale
#auth required pam_succeed_if.so user != root quiet_success
@include common-auth
auth optional pam_gnome_keyring.so
@include common-account
session required pam_limits.so
@include common-session
session optional pam_gnome_keyring.so auto_start
@include common-password
[security]
AllowRoot=true
disable 5 line in /etc/pam.d/gdm3:
#%PAM-1.0
auth requisite pam_nologin.so
auth required pam_env.so readenv=1
auth required pam_env.so readenv=1 envfile=/etc/default/locale
#auth required pam_succeed_if.so user != root quiet_success
@include common-auth
auth optional pam_gnome_keyring.so
@include common-account
session required pam_limits.so
@include common-session
session optional pam_gnome_keyring.so auto_start
@include common-password
czwartek, 13 października 2011
Network miner Ubuntu
shell>sudo apt-get install wine wine-dev cabextract
Configure Wine -
shell>winecfg
In Application tab, change windows version to Windows 2000
shell>wget http://kegel.com/wine/winetricks
Install cofefronts and .net framework 2.0 -
shell>sh winetricks corefonts dotnet20
Download NetworkMiner -
shell>wget \
http://sourceforge.net/project/showfiles.php?group_id=189429
Unzip it and run -
shell>wine NetworkMiner.exe
Configure Wine -
shell>winecfg
In Application tab, change windows version to Windows 2000
shell>wget http://kegel.com/wine/winetricks
Install cofefronts and .net framework 2.0 -
shell>sh winetricks corefonts dotnet20
Download NetworkMiner -
shell>wget \
http://sourceforge.net/project/showfiles.php?group_id=189429
Unzip it and run -
shell>wine NetworkMiner.exe
MBR dd i W7
full hard disk copy
dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image
dd if=/dev/hdx | gzip > /path/to/image.gz
Hdx could be hda, hdb etc. In the second example gzip is used to compress the image if it is really just a backup.
Restore Backup of hard disk copy
dd if=/path/to/image of=/dev/hdx
gzip -dc /path/to/image.gz | dd of=/dev/hdx
MBR backup
In order to backup only the first few bytes containing the MBR and the partition table you can use dd as well.
dd if=/dev/hdx of=/path/to/image count=1 bs=512
MBR restore
dd if=/path/to/image of=/dev/hdx
Add "count=1 bs=446" to exclude the partition table from being written to disk. You can manually restore the table.
WINDOWS 7
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
dd if=/dev/hdx of=/dev/hdy
dd if=/dev/hdx of=/path/to/image
dd if=/dev/hdx | gzip > /path/to/image.gz
Hdx could be hda, hdb etc. In the second example gzip is used to compress the image if it is really just a backup.
Restore Backup of hard disk copy
dd if=/path/to/image of=/dev/hdx
gzip -dc /path/to/image.gz | dd of=/dev/hdx
MBR backup
In order to backup only the first few bytes containing the MBR and the partition table you can use dd as well.
dd if=/dev/hdx of=/path/to/image count=1 bs=512
MBR restore
dd if=/path/to/image of=/dev/hdx
Add "count=1 bs=446" to exclude the partition table from being written to disk. You can manually restore the table.
WINDOWS 7
bootrec /fixmbr
bootrec /fixboot
bootrec /rebuildbcd
Subskrybuj:
Posty (Atom)