Linux creating CD-ROM ISO image
dd is a perfect tool for copy a file, converting and formatting according to the operands. It can create exact CD-ROM ISO image.
This is useful for making backup as well as for hard drive installations require a working the use of ISO images.
How do I use dd command to create an ISO image?
Put CD into CDROM
Do not mount CD. Verify if cd is mounted or not with mount command:
# mount
If cd was mouted automatically unmout it with umount command:
# umount /dev/cdrom
OR
# umount /mnt/cdrom
Create CD-ROM ISO image with dd command:
# dd if=/dev/cdrom of=/tmp/cdimg1.iso
Where,
if=/dev/cdrom: Read from /dev/cdrom (raw format)
of=/tmp/cdimg1.iso: write to FILE cdimg1.iso i.e. create an ISO image
Now you can use cdimg1.iso for hard disk installation or as a backup copy of cd. Please note that dd command is standard UNIX command and you should able to create backup/iso image under any UNIX like operating system.
01 Feb 2000
Learn how to improve the swap performance on your Linux server by several orders of magnitude. Author Daniel Robbins takes you through this quick tip on getting the most from your server.
When you set up a brand new Linux server, do you create a single 128 MB swap partition? If so, did you know that you are severely limiting swap performance? Would you like to increase swap performance by several orders of magnitude, and to create swap partitions larger than 1 GB? It’s possible, requiring no kernel patches or special hardware, just pure geek know-how!
Some of you may not really care about swap. After all, Linux systems are typically very memory efficient, and swap is often barely touched. While often true on desktop systems, servers are another story. Because servers may handle unexpected stresses, such as runaway processes, denial of service attacks, or even the Slashdot effect, they need to have adequate high-speed swap so that they do not grind to a halt and possibly crash when all physical memory (and then some) is exhausted.
Still not convinced that this is a big deal? I’ll show you how easy it is to bring down a server by launching a massive amount of new processes. (Please, if you try this, do it only on a non-production server that you actually administer!) Let’s say you have two customized grep commands in /usr/bin, called bobgrep and jimgrep. Now, let’s assume that bobgrep is simply a shell script that calls the ELF executable jimgrep, as follows:
#!/bin/bash
jimgrep -r $*
Everything looks good so far, but what happens if jimgrep gets accidentally replaced with a symbolic link to bobgrep? Well, in that case, calling bobgrep or jimgrep will cause an infinite loop, causing hundreds of bash processes to be spawned in mere seconds. This actually happened to me once, and believe me, it hurt!
If a server doesn’t have adequate swap, a situation like this can cause the machine to lock up in much less than a minute. How do we fix the problem? One way is to increase the swap size beyond 128 MB. Fortunately for us, there is absolutely no 128 MB limit on swap under Linux 2.2.x+ and later kernels, as there was in the past. The current limits are approximately 2 GB on x86, PowerPC, and MC680×0 systems, 512 MB on MIPS systems, 128 GB on Alpha, and a whopping 3 Terabytes on UltraSparc platforms!
Swap partition size limits under modern Linux kernels
x86 2 Gigabytes
PowerPC 2 Gigabytes
Motorola 680×0 2 Gigabytes
Sparc 1 Gigabyte
MIPS 512 Megabytes
Alpha 128 Gigabytes
UltraSparc 3 Terabytes
While it’s nice to be able to increase swap partition size to beyond 128 MB, how about increasing performance? Ideally, it would be nice if we could set up swap partitions in a RAID 0 stripe, so that reads and writes are equally distributed between all partitions. If these partitions are on separate drives and/or controllers, this will multiply swap file performance, allowing your servers to handle temporary memory usage “spikes” without getting dramatically bogged down.
Amazingly, all modern Linux kernels, by default (with no special kernel options or patches) allow you to parallelize swap, just like a RAID 0 stripe. By using the pri option in /etc/fstab to set multiple swap partitions to the same priority, we tell Linux to use them in parallel:
Set multiple swap partitions to the same priority
/dev/sda2 none swap sw,pri=3 0 0
/dev/sdb2 none swap sw,pri=3 0 0
/dev/sdc2 none swap sw,pri=3 0 0
/dev/sdd2 none swap sw,pri=1 0 0
In the above example, Linux will use swap partitions sda2, sdb2, and sdc2 in parallel. Since these partitions are on different drives, and possibly even different SCSI controllers, read and write throughput will nearly triple. The fourth swap partition, sdd2, will be used only after the first three partitions have been exhausted.
The pri option is really easy to use. The priority must be a number between 0 and 32767, with 32767 being the highest priority. The swap partitions will be used from highest priority to lowest priority, meaning that a partition with a priority of x will only be used only if all partitions with a priority greater than x are already full. If several partitions have the same priority, Linux will automatically parallelize access between them. This allows you to not only parallelize swap, but also prioritize access so that the partitions on the fastest drives (or regions of the drives) are used first. So, you can set up an emergency swap partition on an old, slower drive that will be used only if all high-speed swap is exhausted first.
Now it’s time to put some of this swapping knowledge into action. To loosely quote Mr. Miyagi of Karate Kid fame: “Swap on, swap off, geek-san!”
Have you ever want to split a large file into several small files? I’ve face this problem few days ago. I need to split a large file (3GB log file) into several smaller file where i can read it using normal text editor.
To split large file into several smaller files, you can use split command in linux. Just follow the steps below and you will be able to split large file into smaller files.
in your shell key in
$ split –bytes=1m /path/to/large/file
/path/to/output/file/prefix
Done. You just split your large file into several smaller files
* You can change the output file size by changing the –bytes=1m to your preference. You can use b, k, or m. b represent bytes, k represent kilobytes, m represent megabytes.
To restore the original file, you can use cat command.
To join all the smaller file to restore the original file type:-
$ cat prefix* > NEWFILENAME
Untuk Linux, stepnya adalah sebagai berikut :
1. Download XAMPP dari Apachefriends.org
2. Masuk sebagai root
# su
3. Extract XAMPP
# tar xvfz xampp-linux-X.Y.Z.tar.gz -C /opt
Ganti X, Y dan Z dengan versi XAMPP yang didowonload
4. Jalankan XAMPP
/opt/lampp/lampp start
Akan ada keterangan proses aktifasi aplikasi
XAMPP seperti berikut ini :
Starting XAMPP
1.6.5a…
LAMPP: Starting Apache…
LAMPP: Starting MySQL…
LAMPP started.
5. Test jalannya XAMPP dengan mengetikkan alamat
http://localhost di browser. XAMPP akan segera tampil.
Jika kita melakukan restart komputer, kita harus menjalankan XAMPP secara manual dengan perintah /opt/lampp/lampp start. Bagaimana kalau kita ingin secara otomatis menjalankan XAMPPsetiap kali booting ?
Langkah berikut adalah proses mengaktifkan XAMPP saat booting menggunakan SUSE 10.3
1. Masuk folder runlevel anda (standar GUI dengan network adalah runlevel5)
# cd /etc/init.d/rc5.d (sesuai dengan init default yang anda gunakan)
2. Ketikkan statement berikut :
# ln -s /opt/lampp/lampp /etc/init.d/lampp
3. Check melalui YAST | SYSTEM | SYSTEM SERVICES (RUNLEVEL), cari service lampp, jika masih disable jadikan sebagai enable service.
berikut source list yang bisa menjadi sumber repo:
- http://kambing.ui.edu/opensuse-packman/suse/10.3/
- http://kambing.ui.edu/opensuse/distribution/10.3/repo/oss/
- http://kambing.ui.edu/opensuse/distribution/10.3/repo/non-oss/
- http://kambing.ui.edu/opensuse/update/10.3
ciri apakah sebuah website bisa dibuat repo adalah adanya directory.yast di halaman pagesnya
khusus yang no 4. tidak perlu
saya install opensuse 10.3 kembali lewat virtual box karena permintaan si doni ‘dondong’ sp dan berbagai alasan lain yang mengikutinya.
maksud hati ingin mendokumentasikannya dalam video, tapi g kesampaian juga. abis ‘cupang’ banget c. tapi satu yang patut dipelajari adalah saat kita melakukan perekaman video kita harus fokus dalam window yang ingin kita rekam. soalnya resource buat recordmydesktop ini cukup besar untuk menulis di konsole aja lama amat.
begitu selesai merecord segera encode aja…. jangan dicancel… ntar keluarannya berupa out.ogv (kalo tidak salah)
maksud hati pengin supply di youtube.com (laen kali aja de)
sering lupa dan lupa yah kutulis lagi deh dari pada memenuhi memory otaku
go for reference
dd command syntax
The syntax of dd is as follows:
dd if=INPUT-FILE-NAME of=OUTPUT-FILE-NAME
dd command examples
So to backup /dev/hda3 under Linux command should be as follows i.e. linux filesystem backup with dd:
# dd if=/dev/hda3 of=/backup/myhostname-15-nov-05-hda3.bak.dd
However if you are running planning to run dd in background and if you wish to kill it or want to sending a SIGUSR1 single to a running dd process then you need to start dd as follows (this is really useful stuff):
# dd if=/dev/hda3 of=/backup/myhostname-15-nov-05-hda3.bak.dd; dpid=$!
Now use kill command as follows:
# kill -USR1 $dpid; sleep 5; kill $dpid
dd command to backup boot loader / MBR
dd can be use to backup your boot loader too (if you install a Windows after Linux it will destroy grub/lilo boot loader):
# dd if=/dev/hdX of=/backup/mbr.bak bs=512 count=1
You can restore MBR with the following dd command:
# dd if=/backup/mbr.bak of=/dev/hdX bs=512 count=1
Note replace hdX with your actual device name. However I prefer to use grub-install.
Please note that dd is also capable of reading tapes that were created on other UNIX or written in a format other than Unix (like Windows 2000 server).
Here is one more practical example for Solaris UNIX:
To copy all but the label from disk to tape i.e. copy data in 512 KiB blocks between a disk and a tape, but do not save or restore:
# (dd bs=4k skip=1 count=0 && dd bs=512k) /dev/rmt/0
Copy from tape back to disk, but leave the disk label alone (restore):
# (dd bs=4k seek=1 count=0 && dd bs=512k) /dev/rdsk/c0t1d0s2
Backing up entire disk/partition with dd command
Backup /dev/hda to /dev/hdb:
# dd if=/dev/hda of=/dev/hdb conv=noerror,sync
Where,
* /dev/hda: Source disk
* /dev/hdb: Target disk
* sync: Use synchronized I/O for data and metadata
* noerror: Continue copy operation after read errors
dd is an easy to use (real life saver) command. Read the man page of dd for more information.
$ man dd
Install grub
Reboot with a live CD that contains grub. I use RIP linux.
Seed /boot/grub with the proper files.
#mkdir /mnt/boot
#mount /dev/sda2 /mnt/boot
#mkdir /mnt/boot/grub
#cp /usr/lib/grub/i386-pc/* /mnt/boot/grub
[edit] Install grub
(in my case grub on RIP identifies my SATA drive as the second drive (hd1), even though I boot off it and use my IDE drive for data only. When I reboot from the disk, grub will identify my SATA drive as the first drive (hd0))
#grub
>root (hd1,1)
>setup (hd1)
>quit
grub drive (hd1,1) is /dev/sda2 which is where /boot (and the grub install files) are. setup (hd1) replaces the MBR with grub.
[edit] Create menu.lst
You can get info for your specific case at The grub manual
Mine looks like: (notice the different drive designators from the install command…)
timeout 5
default 0
title Zenwalk
root (hd0,1)
kernel vmlinuz-2.6.18.6 root=/dev/sda5
title Windows
rootnoverify (hd0,0)
chainloader +1
makeactive
boot
[edit] Reboot and see what happens!
Some BIOSes don’t have the option, and report S.M.A.R.T. as disabled, but don’t worry, smartctl can enable it (see below). Carefully read the SMART instructions for your motherboard. Sometimes this option maybe intentionally hidden, as shown in this example.
Now let’s install the smartmontools package:
# emerge -av smartmontools
Finally, you have to check if your hard disk(s) support SMART:
# smartctl -i /dev/hda
For SATA drives:
# smartctl -i -d ata /dev/sda
To enable SMART on IDE drives:
# smartctl -s on /dev/hda
To enable SMART on SATA drives:
# smartctl -s on -d ata /dev/sda
[edit] Using smartctl
[edit] SMART Health Status
Let’s check the SMART Health Status:
# smartctl -H /dev/hda
If you read PASSED it’s ok, but if you read FAILED you have to backup your data now: the disk has already failed or it’s predicted to fail within 24 hours!
[edit] Smart Error Log
Now let’s check the SMART Error Log (it’s a list of errors detected by SMART during the disk’s life):
# smartctl -l error /dev/hda
If we read No Errors Logged it’s ok. If there are a few errors (and they are not so recent) you don’t have to worry too much. If there are a lot of errors it’s better if you backup your data as soon as you can.
Reading the SMART Health Status and the SMART Error Log is not enough: you really should do some other specific tests.
[edit] SMART Testing
These tests don’t interfere with the normal functioning of the disk and they can be carried out when you want. I’ll only describe here how to launch them and read their reports; if you want to learn more go here and/or read the man page.
First you should know which tests are supported by your drive:
# smartctl -c /dev/hda
In this way you can also know how much time each of them require.
Now let’s execute the SMART Immediate Offline Test (if supported, of course):
# smartctl -t offline /dev/hda
You only have to wait (smartctl will show you how long). When it finishes, you should check the SMART Error Log again for the report.
di ambil dari dan juga dari sini dariSiniJuga
rpm -ivh fglrx64_6_9_0_SUSE101-8.24.8-1.x86_64.rpm
Perbaharui variabel-variabel lingkungan sistem Anda dengan perintah ini:
ldconfig
Berikutnya, Anda perlu memberitahu SUSE bahwa Anda ingin menggunakan driver ini sebagai ganti driver standar:
aticonfig –initial –input=/etc/X11/xorg.conf
Terakhir, Anda perlu memberitahu YaST, driver mana yang di-load (di dalam contoh ini ada sebuah nol, bukan huruf):
sax2 -r -m 0=fglrx
Sekarang reboot (restart)-lah komputer Anda dengan mengetik perintah berikut:
reboot