- try umount the folder first
- if you mount folder is a HDD, check its filesystem type by fdisk -l
- if it is a NTFS, use the following in fstab :
- /dev/sda1 /mnt/folder ntfs-3g rwx,uid=xe4,iocharset=utf8,umask=000 0 0
- then mount -a
Wednesday, July 31, 2013
How to solve chmod doesn't work on mounted folder
When chmod does not have any effect on mounted folder, it could be wrong filesystem flag being used:
Tuesday, July 30, 2013
Damn you, buggy Samba 3.6.3
I have been finding solution to address a samba sharing (Ubuntu 12.04.2 LTS) for few days, the errors that I faced:
- windows 7 cannot access share
- windows 7 keep asking password to access samba share
- windows 7 computer on other VLAN cannot browse the Ubuntu server with Windows Explorer
- troubleshoot using smbclient -L localhost -U% give errors such as:
- tree connect failed, NT_STATUS_CONNECTION_INVALID
And very very luckily... I found a discussion & an article which discussed about the bug found in Samba 3.6.3, and suggest to upgrade to 3.6.7:
https://www.monlore.nl/blog/?p=226 (Marcel's blog)
Thanks god their suggestion work.. and damn Ubuntu & Samba, how could they release such a buggy version for LTS and do not issue immediate upgrade in the official repository?!!
Alright, here's the solution copy from Marcel's blog:
- sudo add-apt-repository ppa:nathan-renniewaldock/ppa
- apt-get update
- apt-get install samba
Voila! Now Samba works like a charm!
Saturday, July 27, 2013
[Ubuntu] The bad day!! How to recover from dmraid
Today is a real bad day, one of the Ubuntu server that I "managed" (it's not me who installed it) has gone down! There could be two reasons:
- Incompatible version of Zentyal (Zentyal 3.0 was accidentally installed on this 12.10, causing the samba not functioning)
- The electrical leak in the office due to DP box does not have proper earth line installed. Damn it, the whole rack is covered by electricity, and I got an electric shock! Luckily it was not at high current else all devices and I would have died =_=!
Well.. after hours of troubleshooting, I could not bring the server up and running again. It halted at different stage of loading, sometimes failed to load Samba, sometimes failed at Checking Quota...
I do suspect it is caused by the Zentyal... but time is running out. I rush back to home, taking my laptop SSD* installed with Ubuntu 12.10, together with as many as HDD I could found available for the backup**, and plugged into the server.
Voila! Now I'm inside my laptop Ubuntu, and by running dmraid -r, I could now see the RAID under name isw_xxxxx (isw is a prefix for Intel RST). By running dmraid -ay (activate with silent mode YES), I can now see the whole RAID in Nautilus.
I'm backing up those file now... hopefully the files and directories in the server are still in good condition. Losing a single files will be disaster. Cross finger!
=======================
* Why SSD? Because the Ubuntu server was installed using dmraid and Intel RST (Rapid Storage Technology), so SSD can work well as most of the time SSD is used under AHCI. SATA drive that previously installed without AHCI would fail to boot up.
** Please make sure you use a reliable HDD for the backup. You won't like to fail the second time where you could be only having once chance to perform the recovery.
*** Regarding the mdadm and dmraid, here are some good reads:
*** Regarding the mdadm and dmraid, here are some good reads:
- https://help.ubuntu.com/community/FakeRaidHowto
- http://raid6.com.au/posts/mdadm_advantages/
- http://www.sourceware.org/lvm2/wiki/DMRAID
Monday, July 15, 2013
[Centos] yum-complete-transaction error
These commands are useful when yum-complete-transaction gives error, in my case "error removing yum" & "duplicate packages" (yum-utils need to be installed to perform no. 2 & 3):
- yum-complete-transaction --cleanup-only
- package-cleanup --dupes
- package-cleanup --problems
Thursday, June 6, 2013
Monday, April 29, 2013
[Ubuntu] Wireless stop working after upgrade
If wireless fail to work after upgrade, be sure to use lspci | grep network to look for your wireless device and include this info when you post online for help.
If you're using Broadcom BCM4312 (full name: "Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)") same as mine, then you probably could easily fix by installing the following:
If you choose to reboot and the wireless device doesn't start, try modprobe b43. To autoload the device at startup, edit /etc/modules, add "b43" to the list. That should load it during startup.
Good luck!
If you're using Broadcom BCM4312 (full name: "Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)") same as mine, then you probably could easily fix by installing the following:
sudo apt-get install firmware-b43-installer b43-fwcutter
or try another one if the above doesn't work:
sudo apt-get install broadcom-sta-commonYou're adviced to reboot your system, but before that you may try:
- off & on your wireless device, it may work straight away without system reboot.
- run command modprobe b43
If you choose to reboot and the wireless device doesn't start, try modprobe b43. To autoload the device at startup, edit /etc/modules, add "b43" to the list. That should load it during startup.
Good luck!
Sunday, March 24, 2013
[Ubuntu] iNotify-Tools: The Realtime File Monitoring Tool
I have been searching for a good real time file monitoring tools to save time on checking what directories or files has been updated by my colleagues. It seems the iNotify-Tools that built into Linux kernel has gained a lot of recommendation, and even IBM has an article on their website address for this little tool.
To setup inotify is fairly simple:
External links:
To setup inotify is fairly simple:
- apt-get install inotify-tools
- after install, it comes with two module:
- inotifywait - it runs and keep monitor for changes happen in the target folder/file, and the results can be output to an external file.
- inotifywatch - it outputs a summary count of the events received on each file or directory.
- We will use inotifywait to monitor our folder and output a text file in the same folder.
inotifywait /targetFolder -mr -e create,delete,move --timefmt "%D_%a_%H:%M" --format "%T | %w%f | %e" -o /targetFolder/FolderReport.txt --exclude "FolderReport.txt"
- "-m" is used to continuously monitor the target. Without this, by default it will exit after the first event occurs.
- "-e" is to specify the event that we want to monitor. Full list can be viewed by execute inotifywait -h
- "--timefmt" is used to add date and time to the log. By default the result doesn't has such info.
- "--format" has to be specified if --timefmt is used. %T is the time, %w is the path of the folder being monitored, %f is the file name and %e is the event (action done to the folder/file). We can add any words in between the parameter, and it will be output as well. For example, %w the folder is %f %e will output = "/home/tecsun/folder the folder is TestFolder CREATE,ISDIR. (blue is the output specified by parameter)
- "-o" is to output the result to file (else it would display on the terminal)
- "--exclude" is to exclude the result file being monitored, especially when modify event is triggered, so it won't get into infinity loops.
There is one more tools namely iwatch, which is based on inotify, would allow sending of email when event being triggered. Another one which I have not tested is gamin, if anyone of you happen to test this, please let me know how it works.
External links:
- http://www.ibm.com/developerworks/linux/library/l-ubuntu-inotify/index.html
- A great article with more advanced setup and few other options: http://andries.filmer.nl/kb/Monitoring-file-system-events-with-inotify,-incron-and-authctl/129
- Advanced setup and installation under multiple distros: https://github.com/rvoicilas/inotify-tools/wiki
- http://linuxaria.com/article/introduction-inotify?lang=en
Subscribe to:
Comments (Atom)