Wednesday, August 7, 2013

Cloning XP and linux to a SSD, part1

I've recently bought a Crucial SSD M500 240GB SATA III to substitute my old IDE HD seagate (120GB). 162e from Prokoo, not bad.
Crucial M500 240GB 2.5-inch Internal SSD
Capacity (Unformatted): 240GB
Interface: SATA 6Gb/s (SATA 3GB/s compatible)
Sustained Sequential Read up to (128k transfer): 500MB/s
Sustained Sequential Write up to (128k transfer): 250MB/s
Random Read up to (4k transfer): 72,000 IOPS
Random Write up to (4k transfer): 60,000 IOPS
Form Factor: 2.5-inch, m-SATA, and M.2
NAND: 20nm Micron MLC NND
Life Expectancy: 1.2 million hours mean time to failure (MTTF)
Endurance: 72TB total bytes written (TBW), equal to 40GB per day for 5 years
Operating Temperature: 0°C to 70°C
Compliance: RoHS, CE, FCC, UL, BSMI, C-TICK, KCC RRL, W.E.E.E., TUV VCCI, IC
Firmware: Field upgradable firmware
Product Health Monitoring: Self-Monitoring, Analysis and Reporting Technology (SMART) commands

The old disk hosted WinXP and Ubuntu 10.04, the latter spread on several dedicated partitions (boot, / and swap on this disk, /home on another, larger, SATA disk).

Cloning
Once connected internally to a SATA port my pc (Fujitsu-Siemens, quite old, Athlon64 X2), the SSD took the first disk position (sda) and the old disk moved to the last (sdc).
Cloning with Parted Magic (pmagic_2013_05_01) live from DVD was fast and easy.
It used partclone to copy "disk to local disk" at the astonishing rate of 3.35GB/min!!
Then I edited the grub.cfg file adding a new instance of linux pointing to the correct disk and to differentiate from the grub in the old disk: this would make evident that I'm actually booting from the SSD.
At this point I rebooted, entered BIOS to set the boot disk priority to let the SSD kick in first, rebooted and the grub from the SSD showed up correctly.
So far, so good.
But here my BIG mistake: I booted firstly windows, with BOTH the new and the old disk (cloned) connected.
WinXP did boot, but it went to the old disk, not the new one.
The reason -I've learned after long internet serach- is probably that I didn't change the UUIDs of the partitions of the new disk, therefore the boot got confused and started the old installation. The problem is that windows apparently realised that there was an identical installation on an identical partition and changed something to prevent -possibly- copy of the system.

Lesson learnt: after cloning NEVER reboot with both disks connected! Start with the new one, restart with a liveCD, change the UUIDs, re-install grub, reboot in the new disk (both OSs) and only ath this point you can safely reconnect the old disk!

Before going into the part2, with the recovery and installation of the lates LinuxMint LMDE 201303 along with XP and Ubuntu, here are the final performances:

Win XP:
was 1'16" from grub to the ethernet icon appearance (=system usable)
is ~45"

Ubuntu:
was ~ 47" from grub to the ethernet connected (=system boot finished)
is ~32"

Mint (not installed originally):
is ~ 27" from grub to the ethernet connected (=system boot finished)


Very, very good!

Monday, January 21, 2013

Thumbnails on Synology NAS

After moving from DSM3 to DSM4.0, the NAS started creating thumbnails of images.
This consumes CPU power for ages: several days may be needed to create thumbs, with the disk continuously scratching and the CPU at 100%.
After 15days of processing I was still left with 20000+ images to process.
Peering through the forums I found that this was an issue everybody met and I was eventually pointed to a great script by Phillips312: synoThumbs.sh, which uses your PC CPU and RAM to create the thumbnails and then moves the thumbs to the proper "@eaDir" on the NAS.

This is the comment I left there, to list what I did to let it work:
This works for DSM4.0 and DSM4.1, both tested on my DS210j.

0. pause the thumbnails creation on the NAS (not actually needed)
1. in your linux box, install nfs-common
2. in your DSM control panel, go to NFS management and create the appropriate rules for your PC. In my case, the NAS is on 192.168.2.10. The PC is on 192.168.2.40. The rule I’ve created allows read/write access to 192.168.2.40. It works with “no mapping” and with “mapping to root account” as well. It didn’t work by mapping the hostname, I had to fill in the real IP address.
3. on your PC:
a) showmount -e 192.168.2.10 (to check that the PC ip address is correctly allowed to access)
b) sudo mkdir /mnt/photo
c) cd /mnt
d) sudo cp /path-to-the-script/synoThumbs.sh .
e) sudo chmod u+x synoThumbs.sh
f) sudo mount -o soft,intr,rsize=8192,wsize=8192 192.168.2.10:/volume1/photo /mnt/photo
g) ./synoThumbs.sh photo
4. the script seems to hang doing nothing, but I guess it is just looking through your files. After a while it will start showing thumbnails already created or creating the new thumbs.
5. relax, take your time and say thanks to Phillips312!!!!


Help on NFS found here.

Now, what I'm thinking of is to completely remove the photostation, which is terribly slow to browse. And all those thumbnails are taking a lot of space, too.
So, two interesting links on the subject:

http://forum.synology.com/enu/viewtopic.php?f=17&t=37379&start=150#p229956
1.I created a directory named Photographs under the Files directory.
2.I moved all my photos into this directory.
3.I turn off Media server long enough to change the properties of the “system created” Phot directory and made it hidden to my network places.
4.I restarted Media Server to allow the Diskstation to be seen as a UPnp device on the network again…. No More Coverting…. Hooray!

http://forum.synology.com/enu/viewtopic.php?f=17&t=52060&start=75

1) SSH in to the NAS as root (as previously in this thread)
2) Stop the thumbnailing service
Code: Select all
/usr/syno/etc/rc.d/S77synomkthumbd.sh stop

3) Disable the thumbnailing service app from running (it's a linux thing, this marks the file as not executable)
Code: Select all
chmod -x /usr/syno/bin/synomkthumbd

4) Optionaly, and at your own risk, go in to your files root directory and delete any previously generated thumbnail folders/directories from the whole directory tree
Code: Select all
cd /volume1/
find ./ -type d -name "@eaDir" -exec rm -rf {} \;

And before removing everything, this is what NERDlogger suggests:
Run the command below and it will “echo” the names of these “@eaDir” folders to the terminal. Then once you’re satistied that it’s working well (no weird filenames/characters/etc.), then replace the “echo” with “rm -rf” to actually remove those folders.
find . -name "@eaDir" -type d -print |while read FILENAME; do echo "${FILENAME}"; done