1. create a directory for tiddlywiki
mkdir tdwiki
2. Under this directory, initialize a notebook named "mywiki"
user:~/tdwiki$ tiddlywiki mywiki --init server
Copied edition 'server' to mywiki
After this command, we are supposed to a see sub-directory named "mywiki" created under the parent directory "tdwiki"
3. To load exting tiddlers in index_2015-9-23.html created by tiddlywiki desktop verion
3.1 --type the help on load command
user:~/tdwiki$ tiddlywiki --help load
Load tiddlers from 2.x.x TiddlyWiki files (.html), .tiddler, .tid, .json or other files
3.2 --actual loading
To load tiddlers from the exsiting html file.
tiddlywiki ./MyWiki --load my_encrypted_wiki.html
user:~/tdwiki$ tiddlywiki ./mywiki --load index_2015-9-23.html
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/$__StoryList.tid
syncer-server: Dispatching 'save' task: bf Operator
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/bf_Operator.tid
syncer-server: Dispatching 'save' task: BetaReleases
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/BetaReleases.tid
syncer-server: Dispatching 'save' task: before Operator (Examples)
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/before_Operator_(Examples).tid
syncer-server: Dispatching 'save' task: before Operator
FileSystem: Saved file /home/user/tdwiki/mywiki/tiddlers/before_Operator.tid
...
4. verify that many tiddlers are created under the "miwiki" subdirectory
5. finaly, start the tiddlywiki service for "mywiki" on port 8080 of server ip 192.168.0.96, with logon id & password
nohup /usr/local/bin/tiddlywiki /home/user/tdwiki/mywiki --server 8080 $:/core/save/all text/plain text/html user xxxxxxx 192.168.0.96 &
6. To permanent add it as sysv service in 14.04. I created the following 3 scripts for init.d service to start the service called "mywiki" automatically upon rebooting.
/home/user/tdwiki/start_mywiki.sh
/home/user/tdwiki/stop_mywiki.sh
/etc/init.d/mywiki
user:~/tdwiki$ cat start_mywiki.sh
#!/bin/bash
nohup /usr/local/bin/tiddlywiki /home/user/tdwiki/mywiki --server 8080 $:/core/save/all text/plain text/html user xxxxxxx 192.168.0.96 &
user:~/tdwiki$ cat stop_mywiki.sh
#!/bin/bash
ps -fu user |grep mywiki |grep 8080 |awk '{ print $2 }' | xargs kill
#Note here the scipt name /etc/init.d/mywiki should not have the suffix ".sh"
user:~/tdwiki$ cat /etc/init.d/mywiki
#! /bin/sh
### BEGIN INIT INFO
# Provides: daoqidao wiki
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: for daoqidao tiddlywiki service
# Description: This file starts and stops tiddlywiki server
#
### END INIT INFO
case "$1" in
start)
su user -c /home/user/tdwiki/start_mywiki.sh
;;
stop)
su user -c /home/user/tdwiki/stop_mywiki.sh
sleep 1
;;
status)
ps -fu user |grep mywiki |grep 8080
;;
restart)
su user -c /home/user/tdwiki/stop_mywiki.sh
sleep 2
su user -c /home/user/tdwiki/start_mywiki.sh
;;
*)
echo "Usage: mywiki {start|stop|restart}" >&2
exit 3
;;
esac
7. If all goes well then register the script as an init script:
sudo update-rc.d mywiki defaults
8. Reboot the machine and make sure that Tomcat has started.
References: https://mobiarch.wordpress.com/2014/05/16/creating-an-init-script-in-ubuntu-14-04/
9. I also created a such service in one Ubuntu 15.04, which uses systemd instead to manage the service. The script is different.
user:~/tdwiki/ubuntu15.04$ cat /etc/tiddlywiki.conf
WIKI=/home/user/tdwiki/mywiki
PORT=8080
OPTS="$:/core/save/all text/plain text/html"
USER=user
PWD=xxxxxxx
IP=192.168.0.96
user:~/tdwiki/ubuntu15.04$ cat tiddlywiki.service
[Unit]
Description=TiddlyWiki
After=syslog.target
[Service]
User=user
Group=user
SyslogIdentifier=tiddlywiki
Restart=always
setuid=1000
StandardOutput=syslog
EnvironmentFile=/etc/tiddlywiki.conf
ExecStart=/usr/local/bin/tiddlywiki $WIKI --server $PORT $OPTS $USER $PWD $IP
[Install]
WantedBy=multi-user.target
10. move the file tiddlywiki.service to /etc/systemd/system and ran sudo systemctl enable tiddlywiki.service to create link scripts.
11. Restart server for verification
Monday, September 28, 2015
Friday, September 25, 2015
running tiddlywiki on windows as a service
Referenced below two links: http://tiddlywiki.com/static/Installing%2520TiddlyWiki%2520on%2520Node.js.html
http://www.rubix.nl/blogs/running-tiddlywiki-service-linux-and-windows
But they are not detai enough for me, so list down my steps after spending half an hour on the setup.
1. download node.js from https://nodejs.org/dist/latest/ and installed it.
2. now I have npm.exe to install tiddlywiki.
C:\Users\liqy>npm install -g tiddlywiki
C:\Users\liqy\AppData\Roaming\npm\tiddlywiki -> C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki\tiddlywiki.js
tiddlywiki@5.1.9 C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki
Note that tiddlywiki.js is installed under AppData sub-directory by default.
C:\Users\liqy>
3. now initialize the notebook named "mywiki". The step should be followed, which same as on Linux platform.
Note that the directory for notebook "mywiki" should be empty.
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --init server
Error: Wiki folder is not empty
--this is due to I put a local copy of tiddlywik html file there.
--after remove it , and try again
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --init server
Copied edition 'server' to D:\mydoc\pp\sync\mywiki
3.2 If not, I hit below error when I try to start the service
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all
mywiki.html text/plain
Warning: Wiki folder 'D:\mydoc\pp\sync\mywiki' does not exist or is missing a ti
ddlywiki.info file
Serving on 127.0.0.1:88
(press ctrl-C to exit)
$:/core/modules/commands/server.js:304
if($tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/tiddlyweb") === -1 || $
tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/filesystem") === -1) {
^
TypeError: Cannot read property 'plugins' of null
at Command.execute ($:/core/modules/commands/server.js:304:22)
at Commander.executeNextCommand ($:/core/modules/commander.js:82:14)
at Commander.execute ($:/core/modules/commander.js:46:7)
at Object.exports.startup ($:/core/modules/startup/commands.js:34:12)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1905:10)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.startup (C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywi
ki\boot\boot.js:1856:11)
The command
node .\tiddlywiki.js "D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all mywiki.html text/plain
This is to start the tiddly service listening on localhost port 88 , for notebook named "mywiki"
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all
mywiki.html text/plain
Serving on 127.0.0.1:88
(press ctrl-C to exit)
Boot log:
Startup task: load-modules
Startup task: info after: load-modules before: startup
Startup task: startup after: load-modules
Startup task: story after: startup
Startup task: commands platforms: node after: story
Executing command: rendertiddler $:/core/save/all mywiki.html text/plain
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file D:\mydoc\pp\sync\mywiki\tiddlers\$__StoryList.tid
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file D:\mydoc\pp\sync\mywiki\tiddlers\$__StoryList.tid
5. Confirmed no issue with method, pressed CTRL+C to stop it , and invoke the nssm installed to add service to the windows registry.
D:\tools\nssm\win32>nssm install tiddlywiki
Service "tiddlywiki" installed successfully!
The startup directory in my case is:
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki
The arguments in my case is :
.\tiddlywiki.js "D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all mywiki.html text/plain
By the way, command to edit the tiddlywiki is
D:\tools\nssm\win32>nssm edit tiddlywiki
6.Verify that "tiddlywiki" service is added in "control panel/services"
7. Finally I see it in my web browser with address "http://localhost:88"
8. If there is existing tiddlers in a single html file, I believe tiddlywiki upload command can help to migrate existing tiddlers.
http://www.rubix.nl/blogs/running-tiddlywiki-service-linux-and-windows
But they are not detai enough for me, so list down my steps after spending half an hour on the setup.
1. download node.js from https://nodejs.org/dist/latest/ and installed it.
2. now I have npm.exe to install tiddlywiki.
C:\Users\liqy>npm install -g tiddlywiki
C:\Users\liqy\AppData\Roaming\npm\tiddlywiki -> C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki\tiddlywiki.js
tiddlywiki@5.1.9 C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki
Note that tiddlywiki.js is installed under AppData sub-directory by default.
C:\Users\liqy>
3. now initialize the notebook named "mywiki". The step should be followed, which same as on Linux platform.
Note that the directory for notebook "mywiki" should be empty.
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --init server
Error: Wiki folder is not empty
--this is due to I put a local copy of tiddlywik html file there.
--after remove it , and try again
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --init server
Copied edition 'server' to D:\mydoc\pp\sync\mywiki
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all
mywiki.html text/plain
Warning: Wiki folder 'D:\mydoc\pp\sync\mywiki' does not exist or is missing a ti
ddlywiki.info file
Serving on 127.0.0.1:88
(press ctrl-C to exit)
$:/core/modules/commands/server.js:304
if($tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/tiddlyweb") === -1 || $
tw.boot.wikiInfo.plugins.indexOf("tiddlywiki/filesystem") === -1) {
^
TypeError: Cannot read property 'plugins' of null
at Command.execute ($:/core/modules/commands/server.js:304:22)
at Commander.executeNextCommand ($:/core/modules/commander.js:82:14)
at Commander.execute ($:/core/modules/commander.js:46:7)
at Object.exports.startup ($:/core/modules/startup/commands.js:34:12)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1905:10)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.executeNextStartupTask (C:\Users\liqy\AppData\Roaming\npm\node_m
odules\tiddlywiki\boot\boot.js:1903:21)
at $tw.boot.startup (C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywi
ki\boot\boot.js:1856:11)
4. Try to start the service to see if any error, before adding as a service
The command
node .\tiddlywiki.js "D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all mywiki.html text/plain
This is to start the tiddly service listening on localhost port 88 , for notebook named "mywiki"
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki>node .\tiddlywiki.js "
D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all
mywiki.html text/plain
Serving on 127.0.0.1:88
(press ctrl-C to exit)
Boot log:
Startup task: load-modules
Startup task: info after: load-modules before: startup
Startup task: startup after: load-modules
Startup task: story after: startup
Startup task: commands platforms: node after: story
Executing command: rendertiddler $:/core/save/all mywiki.html text/plain
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file D:\mydoc\pp\sync\mywiki\tiddlers\$__StoryList.tid
syncer-server: Dispatching 'save' task: $:/StoryList
FileSystem: Saved file D:\mydoc\pp\sync\mywiki\tiddlers\$__StoryList.tid
5. Confirmed no issue with method, pressed CTRL+C to stop it , and invoke the nssm installed to add service to the windows registry.
D:\tools\nssm\win32>nssm install tiddlywiki
Service "tiddlywiki" installed successfully!
The startup directory in my case is:
C:\Users\liqy\AppData\Roaming\npm\node_modules\tiddlywiki
The arguments in my case is :
.\tiddlywiki.js "D:\mydoc\pp\sync\mywiki" --server 88 --verbose --rendertiddler $:/core/save/all mywiki.html text/plain
By the way, command to edit the tiddlywiki is
D:\tools\nssm\win32>nssm edit tiddlywiki
6.Verify that "tiddlywiki" service is added in "control panel/services"
7. Finally I see it in my web browser with address "http://localhost:88"
8. If there is existing tiddlers in a single html file, I believe tiddlywiki upload command can help to migrate existing tiddlers.
Monday, September 21, 2015
Migrate Centos 5.11 in my dual boot system
2nd round to migrate this CentOS after I bought a 3TB HDD, on top of one 120GB SSD, one 1TB and one 2TB HDD. Now I want to decommission the 1TB HDD to save energy.
First round the CentOS5 was migrated to the new HDD 3TB,but failed to boot even I re-generate its UUID. After one week's think and research, finally I found that my motherboard doesn't have UEFI support. The error message is like below.
So the solution is to migrate it to the 2TB HDD. The steps are simple.
1. create new partition for / and swap.
2. Use gparted to copy the partition from 1TB HDD to the 2TB HDD partition /dev/sdb2 as shown below.
Before the copy, I gave beautiful label to the partition /dev/sdb2 (CentOS5_Root) and /dev/dba5 (CentOS5_Swap). In fact, these two labels will create new problem for me.
3. regenerate UUID for /dev/sdb2
4. I use GURB2 of ubuntu 15.04 as boot loader installed in SSD, so after copy centos5 I don't need to take care of the grub on this disk /dev/sdb . Was a doubt in my mind. To recognize the centos5 in /dev/sdb2, just issue sudo update-grub2
in Ubuntu, after which I see the /dev/sdb2 entry in the boot menu.
However, because I changed the two partition's LABEL and I didn't remember Volume Group was created in CentOS, caused I hit subsequent errors and spent me another two hours in the midnight.
Notice here not able to find root location /dev/root. As original "LABEL=/" is updated to Ubuntu grub.cfg. This seems Ubuntu grub doesn't know the LABEL being created in gparted.
After I updated root to use "LABEL=/CentOS5_Root", the booting process moved one step further.
This time, I learned faster and revert the two partitions' LABEL to original value. And finally it brings me the clean GUI.
References:
http://ubuntuforums.org/showthread.php?t=1786292
https://frankfzw.wordpress.com/2014/12/23/migrate-ubuntu-14-04-from-hdd-to-ssd/
http://frugaltech.happystoic.com/ssdlinux
https://help.ubuntu.com/community/UsingUUID
https://help.ubuntu.com/community/MovingLinuxPartition
https://www.centos.org/forums/viewtopic.php?t=11207
https://theguyonthe3rdfloor.wordpress.com/2013/02/28/how-to-install-grub-2/
First round the CentOS5 was migrated to the new HDD 3TB,but failed to boot even I re-generate its UUID. After one week's think and research, finally I found that my motherboard doesn't have UEFI support. The error message is like below.
So the solution is to migrate it to the 2TB HDD. The steps are simple.
1. create new partition for / and swap.
2. Use gparted to copy the partition from 1TB HDD to the 2TB HDD partition /dev/sdb2 as shown below.
Before the copy, I gave beautiful label to the partition /dev/sdb2 (CentOS5_Root) and /dev/dba5 (CentOS5_Swap). In fact, these two labels will create new problem for me.
3. regenerate UUID for /dev/sdb2
4. I use GURB2 of ubuntu 15.04 as boot loader installed in SSD, so after copy centos5 I don't need to take care of the grub on this disk /dev/sdb . Was a doubt in my mind. To recognize the centos5 in /dev/sdb2, just issue sudo update-grub2
in Ubuntu, after which I see the /dev/sdb2 entry in the boot menu.
However, because I changed the two partition's LABEL and I didn't remember Volume Group was created in CentOS, caused I hit subsequent errors and spent me another two hours in the midnight.
mount: could not find filesystem '/dev/root'
Notice here not able to find root location /dev/root. As original "LABEL=/" is updated to Ubuntu grub.cfg. This seems Ubuntu grub doesn't know the LABEL being created in gparted.
After I updated root to use "LABEL=/CentOS5_Root", the booting process moved one step further.
This time, I learned faster and revert the two partitions' LABEL to original value. And finally it brings me the clean GUI.
References:
http://ubuntuforums.org/showthread.php?t=1786292
https://frankfzw.wordpress.com/2014/12/23/migrate-ubuntu-14-04-from-hdd-to-ssd/
http://frugaltech.happystoic.com/ssdlinux
https://help.ubuntu.com/community/UsingUUID
https://help.ubuntu.com/community/MovingLinuxPartition
https://www.centos.org/forums/viewtopic.php?t=11207
https://theguyonthe3rdfloor.wordpress.com/2013/02/28/how-to-install-grub-2/
BIOS ACHI screenshots
when the SATA contorl mode =IDE
2 HDD, 1 SSD and 1 DVD ROM
After change the mode to ACHI
Notice the sequence changed, luckily I have already convert my dual boot system not to use the standard partition name, instead , most of my mount points are using by-id.
2 HDD, 1 SSD and 1 DVD ROM
After change the mode to ACHI
Notice the sequence changed, luckily I have already convert my dual boot system not to use the standard partition name, instead , most of my mount points are using by-id.
Sunday, September 20, 2015
few issues with Centos 7.1 installation and BIOS upgrade
1. failed to boot from USB for installation.
followed dd command in https://wiki.centos.org/HowTos/InstallFromUSBkey to create a bootable thumdrive without error, but the USB thumdrive is not detected in the BIOS. My motherboard is GA-P55A-UD3. So the easier way for me is to burn the ISO to a DVD disc.
[ Added Later on ] during BIOS upgrade from version F10 to F11 , I found out the USB thumdrive was not detected due to the extendible USB cable was plugged into USB3.0 port. When I changed to USB2.0 port, my thumdrive is back.
2. I have two hard disks : 2TB and 3TB. Attempted to install on the newly bought 3TB hard disk. Remembered hit kind of internal error. So I decided to install it on the 2TB hard disk.
3. This time round, I choose the software set GNOME-Desktop instead of default minimal installation, which gave me no network, no GUI. That was troublesome.
4. When I install the centos 7.1, the SATA control mode is ACHI. I had Ubuntu 15.04 and CentOS5.11 installed in this computer. The installation finally completed successfuly. And luckily, it didn't touch the GURB2 bootloader of my existing Ubuntu's.
5. However when I boot centos7.1, it panic at "no floppy controller found" and failed to show the GUI. I had no floppy driver and it is shown None in BIOS.
6. Luckily, when I change the SATA controller mode to IDE. The centos7.1 finally boots up. That's is the workaround for the time being. Ubuntu 15.04 will be still the main workstation.
[ Added Later on ] After BIOS upgrade from version F10 to F11, this issue is gone too. Worth it the upgrade. I can stay with ACHI finally.
By upgrading the BIOS, I also gained the stability of Memory, to let my 4x4GB pieces of memory to run at 1600Mhz, and overclocking the CPU from 2.8Ghz to higher frequency @ 3.2GHz. In Ubuntu, tools like hddtemp, sensors, psensor can tell the temperature inside.
cat /proc/cpuinfo helps to tell CPU speed.
This is article introduce rufus and helped to create a bootable MS-DOS in USB drive. In fact, I don't need it. It only after BIOS upgrade, I found there is Q-flash can do the upgrade without needing to boot into any OS.
followed dd command in https://wiki.centos.org/HowTos/InstallFromUSBkey to create a bootable thumdrive without error, but the USB thumdrive is not detected in the BIOS. My motherboard is GA-P55A-UD3. So the easier way for me is to burn the ISO to a DVD disc.
[ Added Later on ] during BIOS upgrade from version F10 to F11 , I found out the USB thumdrive was not detected due to the extendible USB cable was plugged into USB3.0 port. When I changed to USB2.0 port, my thumdrive is back.
2. I have two hard disks : 2TB and 3TB. Attempted to install on the newly bought 3TB hard disk. Remembered hit kind of internal error. So I decided to install it on the 2TB hard disk.
3. This time round, I choose the software set GNOME-Desktop instead of default minimal installation, which gave me no network, no GUI. That was troublesome.
4. When I install the centos 7.1, the SATA control mode is ACHI. I had Ubuntu 15.04 and CentOS5.11 installed in this computer. The installation finally completed successfuly. And luckily, it didn't touch the GURB2 bootloader of my existing Ubuntu's.
5. However when I boot centos7.1, it panic at "no floppy controller found" and failed to show the GUI. I had no floppy driver and it is shown None in BIOS.
6. Luckily, when I change the SATA controller mode to IDE. The centos7.1 finally boots up. That's is the workaround for the time being. Ubuntu 15.04 will be still the main workstation.
[ Added Later on ] After BIOS upgrade from version F10 to F11, this issue is gone too. Worth it the upgrade. I can stay with ACHI finally.
By upgrading the BIOS, I also gained the stability of Memory, to let my 4x4GB pieces of memory to run at 1600Mhz, and overclocking the CPU from 2.8Ghz to higher frequency @ 3.2GHz. In Ubuntu, tools like hddtemp, sensors, psensor can tell the temperature inside.
cat /proc/cpuinfo helps to tell CPU speed.
This is article introduce rufus and helped to create a bootable MS-DOS in USB drive. In fact, I don't need it. It only after BIOS upgrade, I found there is Q-flash can do the upgrade without needing to boot into any OS.
Wednesday, September 09, 2015
SSD trim
This article explains what is TRIM and how to handle in Windows platform.
Below two related to Ubutu, and I am happy to see there is already weekly job for trimming.
tail -n1 /etc/cron.weekly/fstrim
/sbin/fstrim --all || true
http://askubuntu.com/questions/443761/how-is-trim-enabledhttp://askubuntu.com/questions/18903/how-to-enable-trim
However, due to my SSD capacity is small (120GB) only, I decided to have a daily cron job instead
as shown below..
/etc/cron.daily$ cat trimssd
#!/bin/sh
LOG=/var/log/trimssd.log
echo "*** $(date -R) ***" >> $LOG
fstrim -v / >> $LOG
hmc@hmc-P55A-UD3:/etc/cron.daily$ sudo chmod 755 trimssd
hmc@hmc-P55A-UD3:/etc/cron.daily$ sudo ./trimssd
hmc@hmc-P55A-UD3:/etc/cron.daily$ cat /var/log/trimssd.log
*** Wed, 09 Sep 2015 23:11:59 +0800 ***
/: 3.3 GiB (3499556864 bytes) trimmed
SMART data alert: Airflow Temperature and bad sectors
gnome-disks is cool to warn me that my external WD 1TB HDD has 60 degree hot inside it .
At beginning I can't believe until I touch the casing and detach it.
Attempted to open it by viewing a video from Youtube. From the video, it is so compact that nothing I can do event I think I can open it.
From below two links, it seems nothing I can do now, except have an eye on it to prevent data lost. Important data shall be migrated to my NAS.
http://askubuntu.com/questions/342976/how-to-reset-smart-results
http://superuser.com/questions/697384/why-is-the-temperature-so-low-and-airflow-temperature-so-high-on-my-hd
Just now, I re-plug to the USB, running for few minutes on 34'C
For another alert "19 bad sectors" in another disk, my plan is to migrate data out of/dev/sda10 and format it to try my luck, since fsck doesn't overcome it. Its temperature is also 8'C higher than its neighbour - a 2TB HDD, maybe it is getting old truly.
More discussion about bad sectors.
http://ubuntuforums.org/showthread.php?t=2061312
http://www.howtogeek.com/howto/37659/the-beginners-guide-to-linux-disk-utilities/
At beginning I can't believe until I touch the casing and detach it.
Attempted to open it by viewing a video from Youtube. From the video, it is so compact that nothing I can do event I think I can open it.
From below two links, it seems nothing I can do now, except have an eye on it to prevent data lost. Important data shall be migrated to my NAS.
http://askubuntu.com/questions/342976/how-to-reset-smart-results
http://superuser.com/questions/697384/why-is-the-temperature-so-low-and-airflow-temperature-so-high-on-my-hd
Just now, I re-plug to the USB, running for few minutes on 34'C
For another alert "19 bad sectors" in another disk, my plan is to migrate data out of/dev/sda10 and format it to try my luck, since fsck doesn't overcome it. Its temperature is also 8'C higher than its neighbour - a 2TB HDD, maybe it is getting old truly.
More discussion about bad sectors.
http://ubuntuforums.org/showthread.php?t=2061312
http://www.howtogeek.com/howto/37659/the-beginners-guide-to-linux-disk-utilities/
migrate ubuntu 15.04 from HDD to SSD
Factors:
a.) 9 bad sectors reported by gnome-disks.
b.) Interested on new stuff - SSD
e.) Attractive price from Comex: Sandisk 120GB only S$72.
Did some research on the web.
A good article https://help.ubuntu.com/community/MovingLinuxPartition , but seems not update-to-date. Anyway it explains what is going on in details. I followed from step 1 to 4, and part of step 5 & 6 . Since I have no confidence on editing grub.cfg and didn't see below (maybe few detail steps is not descripted clearly)
Thus I abandom the "Refresh the GRUB 2 menu "
Instead , I followed below step to install grub mentioned in http://frugaltech.happystoic.com/ssdlinux and https://frankfzw.wordpress.com/2014/12/23/migrate-ubuntu-14-04-from-hdd-to-ssd/
$ sudo mount -o bind /dev /mnt/ssd/dev
$ sudo mount -o bind /sys /mnt/ssd/sys
$ sudo mount -t proc /proc /mnt/ssd/proc
#$ sudo cp /proc/mounts /media/SSD/etc/mtab --> I skip this command, as it doesn't seem to use UUID.
$ sudo chroot /mnt/ssd
$ grub-install /dev/sdc
$ grub-install --recheck /dev/sdc # only in case of errors in the step before
$ update-grub2
Reboot PC and Yes!18 seconds instead of previous 45 seconds.
Later on I study somemore on mtab and fstab.
Here is one short comparison : http://www.linuxquestions.org/questions/linux-newbie-8/difference-between-mtab-and-fstab-924190/
and more can be found http://ubuntuforums.org/showthread.php?t=1737715
For UUID to be used in fstab, in fact I prefer to use device ID & partition ID, as I have 2 HDDs (1TB Hitachi and 2TB Toshiba) and 1 SDD (120GB Sandisk). Here is my fstab, easier for me to understand.
root@hmc-P55A-UD3:/etc# cat fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/sda10 during installation
# /mnt/shared was on /dev/sda8 during installation
# /mnt/staging was on /dev/sda9 during installation
# /mnt/vm was on /dev/sda7 during installation
# swap was on /dev/sda5 during installation
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part7 /mnt/vm ext3 defaults 0 2
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part8 /mnt/shared ext3 defaults 0 2
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part9 /mnt/staging ext3 defaults 0 2
#/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part10 / ext4 errors=remount-ro 0 1
/dev/disk/by-id/ata-SanDisk_SDSSDA120G_152480401043-part1 / ext4 noatime,nodiratime,errors=remount-ro 0 1
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part5 none swap sw 0 0
#/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part2 none swap sw 0 0
/dev/disk/by-id/ata-TOSHIBA_DT01ACA200_43J1EREGS-part1 /mnt/localubt ext4 defaults 0 2
/dev/disk/by-id/ata-TOSHIBA_DT01ACA200_43J1EREGS-part2 /mnt/shared2 ext4 defaults 0 2
gnome-disks a handy tool to manipulative this.
I also referenced https://radu.cotescu.com/migrating-your-ubuntu-machine-to-a-ssd-drive/
Prepared a few rescue Swiss knives like boot-repair, gparted, unetbootin, clonezilla, Ubuntu live CD (same version as my HDD) in bootable thumdrives.
a.) 9 bad sectors reported by gnome-disks.
b.) Interested on new stuff - SSD
e.) Attractive price from Comex: Sandisk 120GB only S$72.
Did some research on the web.
A good article https://help.ubuntu.com/community/MovingLinuxPartition , but seems not update-to-date. Anyway it explains what is going on in details. I followed from step 1 to 4, and part of step 5 & 6 . Since I have no confidence on editing grub.cfg and didn't see below (maybe few detail steps is not descripted clearly)
1) UBUNTU...
- Finally, once rebooted successfully on new Ubuntu partition
Thus I abandom the "Refresh the GRUB 2 menu "
sudo update-grub
Instead , I followed below step to install grub mentioned in http://frugaltech.happystoic.com/ssdlinux and https://frankfzw.wordpress.com/2014/12/23/migrate-ubuntu-14-04-from-hdd-to-ssd/
$ sudo mount -o bind /dev /mnt/ssd/dev
$ sudo mount -o bind /sys /mnt/ssd/sys
$ sudo mount -t proc /proc /mnt/ssd/proc
#$ sudo cp /proc/mounts /media/SSD/etc/mtab --> I skip this command, as it doesn't seem to use UUID.
$ sudo chroot /mnt/ssd
$ grub-install /dev/sdc
$ grub-install --recheck /dev/sdc # only in case of errors in the step before
$ update-grub2
Reboot PC and Yes!18 seconds instead of previous 45 seconds.
Later on I study somemore on mtab and fstab.
Here is one short comparison : http://www.linuxquestions.org/questions/linux-newbie-8/difference-between-mtab-and-fstab-924190/
and more can be found http://ubuntuforums.org/showthread.php?t=1737715
For UUID to be used in fstab, in fact I prefer to use device ID & partition ID, as I have 2 HDDs (1TB Hitachi and 2TB Toshiba) and 1 SDD (120GB Sandisk). Here is my fstab, easier for me to understand.
root@hmc-P55A-UD3:/etc# cat fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#
# / was on /dev/sda10 during installation
# /mnt/shared was on /dev/sda8 during installation
# /mnt/staging was on /dev/sda9 during installation
# /mnt/vm was on /dev/sda7 during installation
# swap was on /dev/sda5 during installation
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part7 /mnt/vm ext3 defaults 0 2
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part8 /mnt/shared ext3 defaults 0 2
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part9 /mnt/staging ext3 defaults 0 2
#/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part10 / ext4 errors=remount-ro 0 1
/dev/disk/by-id/ata-SanDisk_SDSSDA120G_152480401043-part1 / ext4 noatime,nodiratime,errors=remount-ro 0 1
/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part5 none swap sw 0 0
#/dev/disk/by-id/ata-Hitachi_HDT721010SLA360_STF610MR15HK9P-part2 none swap sw 0 0
/dev/disk/by-id/ata-TOSHIBA_DT01ACA200_43J1EREGS-part1 /mnt/localubt ext4 defaults 0 2
/dev/disk/by-id/ata-TOSHIBA_DT01ACA200_43J1EREGS-part2 /mnt/shared2 ext4 defaults 0 2
gnome-disks a handy tool to manipulative this.
I also referenced https://radu.cotescu.com/migrating-your-ubuntu-machine-to-a-ssd-drive/
Prepared a few rescue Swiss knives like boot-repair, gparted, unetbootin, clonezilla, Ubuntu live CD (same version as my HDD) in bootable thumdrives.
Tuesday, September 08, 2015
steps to upgrade mysql 5.5 to 5.6
A general method:
References:
http://askubuntu.com/questions/614886/upgrading-mysql-5-5-to-mysql-5-6-on-ubuntu-14-04-lts
another good article is http://xmodulo.com/upgrade-mysql-server-debian-ubuntu.html
http://sharadchhetri.com/2014/05/07/install-mysql-server-5-6-ubuntu-14-04-lts-trusty-tahr/
After upgrade, we may see this warning message:
2015-09-07 18:36:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql start/running, process 17378
Processing triggers for ureadahead (0.100.0-16) ...
The solution is set to explicit_defaults_for_timestamp=true in my.cnf
Do check mysql manual to understand its behaviour change of explicit_defaults_for_timestamp .
- use mysqldump to create backups of your database (users, trable
structure and table data) and of your config file (probably
/etc/mysql/my.cnf)
/mnt/ssdata/mysql5.5_bak# time mysqldump --lock-all-tables -u root -p --all-databases > mysql5.5_dump.sql
Enter password:
-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
real 1m50.291s
user 0m52.281s
sys 0m5.228s
try to export again
root@YZ37:/mnt/ssdata/mysql5.5_bak# time mysqldump --events --ignore-table=mysql.events --lock-all-tables -u root -p --all-databases > mysql5.5_dump2.sql
Enter password:
real 1m45.663s
user 1m4.349s
sys 0m5.483s - Remove 5.5. After removing 5.5 check that the innodb transactions files are gone (ibdata1, ib_logfile0 and ib_logfile1). As 5.6 uses the better version of transactioning I assume you also would to use this...
- Install 5.6
sudo apt-get remove mysql-server sudo apt-get autoremove sudo apt-get install mysql-client-5.6 mysql-client-core-5.6 sudo apt-get install mysql-server-5.6
- Change the new config file and add in what you changed for 5.5 (mind though the link above and check if any of the changes have become invalid).
- Upload your backup into 5.6 (users first). Mind that this can take a bit of time since it will recreate new transaction files.
I choose importing user databases one by one, except below these three system databases.
information_schema mysql performance_schema
References:
http://askubuntu.com/questions/614886/upgrading-mysql-5-5-to-mysql-5-6-on-ubuntu-14-04-lts
another good article is http://xmodulo.com/upgrade-mysql-server-debian-ubuntu.html
http://sharadchhetri.com/2014/05/07/install-mysql-server-5-6-ubuntu-14-04-lts-trusty-tahr/
After upgrade, we may see this warning message:
2015-09-07 18:36:32 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
mysql start/running, process 17378
Processing triggers for ureadahead (0.100.0-16) ...
The solution is set to explicit_defaults_for_timestamp=true in my.cnf
Do check mysql manual to understand its behaviour change of explicit_defaults_for_timestamp .
export all mysql user databases at one go
/mnt/ssdata/mysql5.5_bak# time mysqldump --lock-all-tables -u root -p --all-databases > mysql5.5_dump.sql
Enter password:
-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
real 1m50.291s
user 0m52.281s
sys 0m5.228s
There is warning message above, so
/mnt/ssdata/mysql5.5_bak# time mysqldump --events --ignore-table=mysql.events --lock-all-tables -u root -p --all-databases > mysql5.5_dump2.sql
Enter password:
real 1m45.663s
user 1m4.349s
sys 0m5.483s
Enter password:
-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
real 1m50.291s
user 0m52.281s
sys 0m5.228s
There is warning message above, so
/mnt/ssdata/mysql5.5_bak# time mysqldump --events --ignore-table=mysql.events --lock-all-tables -u root -p --all-databases > mysql5.5_dump2.sql
Enter password:
real 1m45.663s
user 1m4.349s
sys 0m5.483s
Funny problem afte reset mysql root password
Followed this link for root password reset,
https://help.ubuntu.com/community/MysqlPasswordReset
However, hit below funny error
user:~/workdir/mysqlbak/5.6shrink$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld X11 connection rejected because of wrong authentication.
No directory, logging in with HOME=/
[ OK ]
* Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
Googled , but no much can help.
Tried my luck to reboot the Ubuntu server, and it seems working fine now.
https://help.ubuntu.com/community/MysqlPasswordReset
However, hit below funny error
user:~/workdir/mysqlbak/5.6shrink$ sudo /etc/init.d/mysql start
* Starting MySQL database server mysqld X11 connection rejected because of wrong authentication.
No directory, logging in with HOME=/
[ OK ]
* Checking for tables which need an upgrade, are corrupt or were
not closed cleanly.
Googled , but no much can help.
Tried my luck to reboot the Ubuntu server, and it seems working fine now.
Monday, September 07, 2015
SSD benchmark of 240GB vs 120GB
Although different brand SSD, I hope they are re-presentable. In general, 240GB has significant performance improved as what I read from some articles.
This seems true based on my benchmark, especially for WRITE and average access time.
BTW, after migrate my Ubuntu from HDD to Sandisk SSD, the bootup time (from grub to first screen of logon window) reduces from 75 seconds to 18 seconds.
Cheers!
This seems true based on my benchmark, especially for WRITE and average access time.
BTW, after migrate my Ubuntu from HDD to Sandisk SSD, the bootup time (from grub to first screen of logon window) reduces from 75 seconds to 18 seconds.
Cheers!
Subscribe to:
Posts (Atom)