Salam
Partisi linux saya, saya jadikan satu. Lalu saya ingin mengetahui di bagian manakah, ruang terbesar yang digunakan dalam satu partisi ini. Bagaimanakah caranya?
Saya gunakan ilustrasi saja supaya lebih jelasnya sebagai contoh:
za@arahmaiani:/$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/hda8 7.4G 6.6G 464M 94% /
tmpfs 570M 0 570M 0% /lib/init/rw
udev 10M 88K 10M 1% /dev
tmpfs 570M 0 570M 0% /dev/shm
/dev/hda5 9.8G 8.5G 1.4G 87% /media/za
/dev/hda1 16G 15G 995M 94% /media/winXP
/dev/hdc 641M 641M 0 100% /media/cdrom0
/dev/sda1 953M 12M 941M 2% /media/usbdisk
Nah, saya ingin tahu, di /dev/hda8 itu terpakai dimana saja hingga space 7.4 GB kok habis.
Apa harus satu-satu menggunakan perintah du?
$ du /home/za/
2058452 /home/za
$ du /etc
$ du /var
Adakah cara yang lebih cerdas?
-za,
Lalu, pertanyaan saya dijawab oleh Mas Ronny Haryanto sebagai berikut:
ni salah satu cara (jalankan dari /):
du -xskc * | sort -rn | head -n 10
Kalo mau yg gui bisa pake filelight atau baobab.
Tampilkan postingan dengan label linux. Tampilkan semua postingan
Tampilkan postingan dengan label linux. Tampilkan semua postingan
Jumat, 18 April 2008
Kamis, 10 April 2008
Mount Loopback
Aku baru tahu fungsinya mount loopback sekarang. Jadi ada bedanya ketika sebelum kita melakukan mount loopback dan sesudah melakukan mount loopback. Aku pakai studi kasus initrd.gz
Pertama-tama salin dulu initrd.gz dari iso linux di cdrom anda
$ cp /media/cdrom0/boot/initrd.gz /home/za/belajar/
Lalu unzip initrd
$ gunzip /home/za/belajar/initrd.gz
Sekarang coba lihat isi file initrd yang telah diekstrak
$ vi /home/za/belajar/initrd
^@@@@@@@@@@@@@
@@@@@@@@@^@@@@
Hahaha... kok jadinya file biner! Oleh karena itu kita perlu melakukan mount loopback.
Sekarang buat direktori percobaan
$ mkdir percobaan
Untuk melakukan mount dibutuhkan akses root. Jadi login dulu sebagai root
# mount -o loop /home/za/belajar/initrd /home/za/belajar/percobaan
Voila, lihatlah sekarang isi direktori percobaan
# cd /home/za/belajar/percobaan
# ls
bin dev etc mnt modules proc sbin sys usr var xan
Setelah ini apa? Saya belum tahu. Iwan bilang sunting berkas rcS di /home/za/belajar/percobaan/etc/init.d/rcS. Cari tahu apa yang dimaui oleh script ini, lalu sesuaikan dengan kebutuhan.
Tralala
Pertama-tama salin dulu initrd.gz dari iso linux di cdrom anda
$ cp /media/cdrom0/boot/initrd.gz /home/za/belajar/
Lalu unzip initrd
$ gunzip /home/za/belajar/initrd.gz
Sekarang coba lihat isi file initrd yang telah diekstrak
$ vi /home/za/belajar/initrd
^@@@@@@@@@@@@@
@@@@@@@@@^@@@@
Hahaha... kok jadinya file biner! Oleh karena itu kita perlu melakukan mount loopback.
Sekarang buat direktori percobaan
$ mkdir percobaan
Untuk melakukan mount dibutuhkan akses root. Jadi login dulu sebagai root
# mount -o loop /home/za/belajar/initrd /home/za/belajar/percobaan
Voila, lihatlah sekarang isi direktori percobaan
# cd /home/za/belajar/percobaan
# ls
bin dev etc mnt modules proc sbin sys usr var xan
Setelah ini apa? Saya belum tahu. Iwan bilang sunting berkas rcS di /home/za/belajar/percobaan/etc/init.d/rcS. Cari tahu apa yang dimaui oleh script ini, lalu sesuaikan dengan kebutuhan.
Tralala
Minggu, 16 Desember 2007
MCNLive Toronto to USB
Aku lagi belajar beragam cara membuat Linux bisa diboot dari USB. Salah satu caranya aku temukan di distro MCNLive Toronto USB. Script-nya terdapat di direktori
Coba perhatikan baik-baik isi script-nya agar bisa mengerti:
Untuk sementara aku tulis dulu aja, belum sempat menganalisa.
/usr/local/bin/mkmcnlive
Coba perhatikan baik-baik isi script-nya agar bisa mengerti:
#!/bin/sh
# MCNLive To flash drive install, without formatting
# (c) 2005, 2006 Chris, mcnlive@googlemail.com
# (c) www.mandrivaclub.nl
# Requires Zenity
# Licence GPL 2.0 or later
#### Check for root ####
if [ "$UID" != "0" ]; then
echo "This script must be run as root."
exit
fi
#### Constants, Functions ####
#
## Constants
DIALOG=zenity
ERROR="LiveUSB: Error Occurred"
USB="$DEVICE"1
DATA="$DEVICE"2
MOUNT="$USB"
MOUNT2="$DATA"
TMP="/tmp/mkmcnlive.tmp"
echo " " > $TMP
goodbye() {
[ -n "$MOUNT" ] && umount -dlf "$MOUNT" 2>/dev/null
[ -n "$MOUNT2" ] && umount -dlf "$MOUNT2" 2>/dev/null
umount -dl /mnt/usbstick 2>/dev/null
exit 0
}
#### Report error and exit
error() {
$DIALOG --error --text="$1" --title="$ERROR"
}
#### Command
cmd() {
echo "> $1 " >> "$TMP"
$1 2>"$TMP"
OK=$?
RESULT="$(<$TMP)"
echo "OK = $OK" >>"$TMP"
if [ "$OK" != "0" ]; then # Haarlem, we have a problem
if [ "$3" = "WARN" ]; then
#$DIALOG --title "WARNING" --sorry "$2"
$DIALOG --warning --text="$2"
elif [ "$3" = "STOP" ]; then # Bad error - stop
error "ERROR:$2: $RESULT" # Send to error func
goodbye
fi
fi
}
trap goodbye 1 2 3 15
###### MAIN SCRIPT ######
#
### Setup
echo "Starting mkmcnlive"
echo "Dialog = $DIALOG"
TITLE1="Create MCNLive on a Flash Drive "
$DIALOG --question --title="$TITLE1" --width=600 --height=800 --text=" This wizard creates a bootable USB Flash Drive on your chosen usb device. Before proceeding please notice:
0. All detected usb devices, flash drives, external harddrives and *internal sata disks* are shown. Before proceeding, make sure which device is the correct one. Use the Mandriva Control Center or the command line: fdisk -l.
1. Your BIOS must support USB-HDD booting. When using this wizard: - don't boot with the copy2ram cheatcode, -plug in your usb flash drive after you booted sucessfully.
2. Your flash drive needs a capacity of at least 512 MB.
3. It already has valid FAT formatted partition(s), partition 1 needs at least 480 MB available space. This wizard does not repartition or format your device. You can do this in the Mandriva Control Center. Be sure that the boot flag is set on the first partition.
4. Files will be copied to the first partition, syslinux bootloader installed, a valid MBR written.
*** No responsibility for data loss or hardware damage! ***
*** Press 'Cancel' if you want to stop. ***
Please verify that your usb flash drive is plugged in and press 'OK' to proceed."
if [ "$?" = "1" ]; then
error "Exiting. You chose not to continue."
exit 0
fi
#### Find the usb devices
DEVICES=""
for stick in /dev/sd[a-h]
do
if [ -e "$stick" ]; then
DEVICES="$DEVICES $stick"
echo " Found the following USB devices: $stick"
else
## Nothing found
error "Error: No suitable USB devices found :-("
exit 0
fi
done
#### PAGE 2: User selects the usb device
TITLE2="Select USB Device"
MESSAGE2="Please select a USB device to prepare.
Make sure *not* to select an internal SATA harddisk, or an external large harddisk."
DEVICE=""
while [ "$DEVICE" = "" ];
do
$DIALOG --list --title="$TITLE2" --text="$MESSAGE2" \
--column="USB Device" $DEVICES 1>"$TMP"
if [ "$?" = "1" ]; then
error "Exiting. You chose not to continue."
exit 0
fi
DEVICE="$(<$TMP)"
done
## Unmount if mounted
USB="$DEVICE"1
DATA="$DEVICE"2
(
cmd "umount -dlf $USB" 2>/dev/null
# installing MBR
cmd "dd if=/usr/local/bin/mbr.bin of=$DEVICE" "Problem writing MBR" "STOP"
# echo " Setting up boot loader on $DEVICE"
cmd "/usr/bin/syslinux $USB" "Problem installing bootloader" "STOP"
sync
# Copying the files
IMAGE="/initrd/cdrom"
cmd "mkdir -p /mnt/usbstick"
cmd "mount -t vfat $USB /mnt/usbstick"
cmd "cp $IMAGE/isolinux/* /mnt/usbstick"
cmd "rm /mnt/usbstick/isolinux.cfg"
cmd "rm /mnt/usbstick/isolinux.bin"
cmd "cp /usr/local/bin/splash.msg /mnt/usbstick"
cmd "cp /usr/local/bin/syslinux.cfg /mnt/usbstick"
cmd "cp $IMAGE/livecd.sqfs /mnt/usbstick" "Problem copying files. Exiting." "STOP"
sync
umount /mnt/usbstick
) | $DIALOG --progress --percentage=0 --title="Creating MCNLive USB" --text="Creating LiveUSB, this can take some minutes ...
Please be patient. When the OK button is active again, click on it."
#### Finished ####
TITLE4="FINISHED"
MESSAGE4="MCNLive successfully created on $DEVICE. You can unplug it now.
When rebooting, please check your BIOS settings while the flash drive is inserted!
Press 'OK' to finish."
$DIALOG --info --title="$TITLE4" --text="$MESSAGE4"
exit 0
Untuk sementara aku tulis dulu aja, belum sempat menganalisa.
Senin, 19 November 2007
Lokasi MAN
Dimanakah lokasi berkas man dalam Linux? Maksudnya ketika kita mengakses dokumen man dengan perintah seperti
Ada yang tahu?
$ man tcpdump
Ada yang tahu?
Langganan:
Postingan (Atom)