Copy Link
Add to Bookmark
Report

Echo Magazine Issue 08 Phile 0x019

eZine's profile picture
Published in 
Echo Magazine
 · 4 years ago

  



____________________ ___ ___ ________
\_ _____/\_ ___ \ / | \\_____ \
| __)_ / \ \// ~ \/ | \
| \\ \___\ Y / | \
/_______ / \______ /\___|_ /\_______ /
\/ \/ \/ \/


.OR.ID
ECHO-ZINE RELEASE
08

Author: y3dips || y3dips@echo.or.id
Online @ www.echo.or.id :: http://ezine.echo.or.id


~= Membuat program kecil untuk Flashdisk =~

Pengantar
---------

artikel ini cuma buat bersenang senang saja, sekalian belajar programing.
khususnya buat yang ingin belajar "bash" programing, dan juga refresing. Buat
yang dah bisa, buat yang "master" ,saya mohon maaf nih kalo 'malu-maluin.
Namanya juga baru belajar :),terus terang skrip itu sebenarnya dah lama saya
buat, tetapi bukan untuk flashdisk :D , karena iseng yach jadi deh di buat
untuk mounting usb flashdisk :)

Oh ya, artikel ini khusus buat linux kamu (distro) yang belum secara otomatis
mounting usb flashdisk kamu ? , ini aku coba di fedora core release 1 (yarrow)
yang aku gunakan.

C0RE
----

Pertama tama buat dahulu direktori "fl"<nama terserah> di /mnt untuk tempat
mounting flashdisk kita nantinya (buat yang gak tau "mount" bisa baca baca
dokumentasi tentang "mount" atau ketik "man mount" )

#mkdir /mnt/fl

Koneksikan flashdisk yang kamu miliki ke port USB yang ada di PC/laptop kamu,
selanjutnya gunakan perintah "dmesg" untuk melihat informasi usb flashdisk
yang kamu miliki :

#dmesg

---snip-----

hub.c: new USB device 00:05.2-2, assigned address 2
hub.c: USB hub found
hub.c: 1 port detected
hub.c: new USB device 00:05.2-2.1, assigned address 3
usb.c: USB device 3 (vend/prod 0x67b/0x2517) is not claimed by any active driver.
Initializing USB Mass Storage driver...
usb.c: registered new driver usb-storage
scsi0 : SCSI emulation for USB Mass Storage devices
Vendor: USB 2.0 Model: Flash Disk Rev: PROL
Type: Direct-Access ANSI SCSI revision: 02
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 3
USB Mass Storage support registered.
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
SCSI device sda: 256000 512-byte hdwr sectors (131 MB)
sda: Write Protect is off
sda: sda1 sda2 sda3 sda4

---snip-----

ternyata USB Flashdisk yang kamu miliki dikenali ,dan di attached di sda

sebenarnya kamu bisa langsung melakukan mounting dengan mengetikkan

#mount /dev/sda /mnt/fl

tetapi kita gunakan cara berikut ,


selanjutnya definisikan hardware yang kamu miliki di file /etc/fstab

bisa dengan

#vi /etc/fstab

dan tambahkan

/dev/sda /mnt/fl vfat defaults

atau dengan,

#echo "/dev/sda /mnt/fl vfat defaults" >> /etc/fstab


sebenarnya kita tinggal melakukan mounting saja, tetapi biar lebih mudah
kita bisa membuat skrip kecil untuk mempermudahnya

--- script ----

!/bin/bash
case "$1" in
M)
echo -n "Mount Flashdisk "
mount /mnt/fl
echo
;;

U)
echo -n "Unmount Flashdisk"
echo
umount /mnt/fl
;;
*)
echo "Gunakan : $0 { M (mount) | U (unmount) }"
exit 1
esac
exit 0

--- [ EOF ] ----

Simpan dengan nama "flash" , set permission "execute" dengan mengetikkan

#chmod 755 flash ,atau

#chmod +x flash

selanjutnya skrip kecil kita siap untuk di manfaatkan seperlunya :), setiap anda
selesai mengkoneksikannya anda tidak perlu mengetikkan

#mount /mnt/fl

coba anda aksekusi file ./flash

#./flash
Gunakan : ./flash { M (mount) | U (unmount) }

untuk melakukan mounting cukup dengan

#./flash M
Mount Flashdisk

sedangkan untuk mengUnmountnya

#./flash U
Unmount Flashdisk

Done !!!

*you have to be root to do this all

greetz to:
[echostaff : moby, comex, the_Day, z3r0byt3, K-159, c-a-s-e, S'to]
{ISICteam : yudhax, anton, balai_melayu, wisnu, biatch-X },

anak anak newbie_hacker[at]yahoogroups.com , #e-c-h-o , #aikmel

kirimkan kritik && saran ke y3dips[at]echo.or.id

*/0x79/0x33/0x64/0x69/0x70/0x73/* (c)2004


← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

guest's profile picture
@guest
12 Nov 2024
It is very remarkable that the period of Atlantis’s destruction, which occurred due to earthquakes and cataclysms, coincides with what is co ...

guest's profile picture
@guest
12 Nov 2024
Plato learned the legend through his older cousin named Critias, who, in turn, had acquired information about the mythical lost continent fr ...

guest's profile picture
@guest
10 Nov 2024
الاسم : جابر حسين الناصح - السن :٤٢سنه - الموقف من التجنيد : ادي الخدمه - خبره عشرين سنه منهم عشر سنوات في كبرى الشركات بالسعوديه وعشر سنوات ...

lostcivilizations's profile picture
Lost Civilizations (@lostcivilizations)
6 Nov 2024
Thank you! I've corrected the date in the article. However, some websites list January 1980 as the date of death.

guest's profile picture
@guest
5 Nov 2024
Crespi died i april 1982, not january 1980.

guest's profile picture
@guest
4 Nov 2024
In 1955, the explorer Thor Heyerdahl managed to erect a Moai in eighteen days, with the help of twelve natives and using only logs and stone ...

guest's profile picture
@guest
4 Nov 2024
For what unknown reason did our distant ancestors dot much of the surface of the then-known lands with those large stones? Why are such cons ...

guest's profile picture
@guest
4 Nov 2024
The real pyramid mania exploded in 1830. A certain John Taylor, who had never visited them but relied on some measurements made by Colonel H ...

guest's profile picture
@guest
4 Nov 2024
Even with all the modern technologies available to us, structures like the Great Pyramid of Cheops could only be built today with immense di ...

lostcivilizations's profile picture
Lost Civilizations (@lostcivilizations)
2 Nov 2024
In Sardinia, there is a legend known as the Legend of Tirrenide. Thousands of years ago, there was a continent called Tirrenide. It was a l ...
Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT