OpenWRT
Posted by Achmad 'Rhoma' Fanani (kanny) on 11/04/2011 05:59:00 AM
Sedikit catatan perjalanan ngoprek OpenWrt pd TP-Link MR3420
Link:
http://downloads.openwrt.org/snapshots/trunk/ar71xx/
http://www.kaskus.us/showthread.php?t=10124215
command penting yg kadang lupa" ingat:
# opkg
# logread -f
# dmesg
Howto mount drives by ID ( /dev/disk/by-id )
Maybe this is useful for someone...
Before we begin... you might want to disable automounting of devices...
Do this by simply putting hashes ("#") in front of the following lines in the file /etc/hotplug.d/block/10-mount
"mkdir -p /mnt/$device"
"mount /dev/$device /mnt/$device"
"umount /dev/$device"
(You can of course also delete the file, however you might need it some time later...)
-----
You need to install the util-linux-ng mount-utils, because the busybox mount command doesn't work by IDs.
Do the following:
opkg update
opkg install mount-utils
The second command will fail, because /bin/mount and /bin/umount already exist. -> Simply delete those two and try again. They are only symlinks to the busybox-executable.
If you want to revert to the original status some time later, do:
opkg remove mount-utils
cd /bin
ln -s busybox mount
ln -s busybox umount
-----
Howto mount drives by ID ( /dev/disk/by-id )
-----
Since the last release, the /dev/disk dynamic directory has disappeared. However you can get it back.
opkg update
opkg install udev
opkg remove udevtrigger
Nevertheless you must also start the udev daemon somehow:
Paste the following (excluding the lines) into the new file /etc/init.d/udev
-------------------------------------------------------
#!/bin/sh /etc/rc.common
# Copyright (C) 2009 OpenWrt.org
START=19
start() {
#make sure deamon is not running
killall udevd > /dev/null 2> /dev/null
#start the deamon
udevd --daemon --debug
#Force it to evaulate already connected devices
udevadm trigger
#This should block until all events are processed - however it does not work currently
udevadm settle
#Until someone fixes it ... 5 seconds longer to boot...
sleep 5
}
stop() {
killall udevd
}
--------------------------------------------------------------
... and execute the following commands afterwards:
chmod 755 /etc/init.d/udev
/etc/init.d/udev enable
Connect a USB-Stick or USB-Enclosure and reboot your box.
You should now see the /dev/disk/ directory.
I assume you have already tried mounting the device traditionally ("mount /dev/sda1 /mnt" or so )
If this works, you should now be able to mount the device via its ID too.
In my case:
"mount /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_5B81DC001388-0:0-part1 /mnt"
(You might want to test whether your hotplug-commands still work...)
------
Howto mount devices by ID at startup
------
If you want, you can use the config infrastructure of openwrt to mount devices by id at startup:
Go to /etc/config/fstab (not /etc/fstab!) and add a block somewhat like this
-------------------------------------------------
config mount
option target /mnt
option device /dev/disk/by-id/usb-Kingston_DataTraveler_2.0_5B81DC001388-0:0-part1
option fstype ext2
option options rw,sync
option enabled 1
-------------------------------------------------
reboot -> mounted.
---
Nama Anda
New Johny WussUpdated: 11/04/2011 05:59:00 AM
0 komentar:
Post a Comment