Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

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

Monday, February 22, 2010

Grub2: terribly slow at boot

Karmic Koala comes with Grub2, on a fresh install (but it will keep grub legacy on upgrades).

Beside the scarcely comprehensible layer of complexity that grub2 has added to the great old grub, I was very disappointed by the long delay on boot.
After BIOS, the booting process just hanged with a "GRUB starting" message on black screen.
It stays like that for ~15-20 seconds.
Than grub menu shows up.
Amazing, since Karmic was said to be one of the fastest booting experiences one could have....

Now, poossibly the solution is here:

Grub 2 Hangs 10-30 Seconds between Grub 2 Loading and Menu Display.
This is a known bug that can be caused by GRUB 2 and /boot being loaded on different partitions. To fix the problem, run
Code:
sudo dpkg-reconfigure grub-pc
Select to load Grub 2 on the same device as the /boot partition. In your system BIOS, change the drive to boot from first to the drive with the /boot partition.

As it happens, my /boot partition and my /home are on two different disks.
I need to check, but it might actually be that grub got installed on the disk with the /home partition and not the one with /boot and / partitions (which is amazing, since I kept the insalling disk for grub suggested by the installation process....).

Friday, February 19, 2010

Sound issues on Karmic 64bit

Issue and possible solutions, just listed, very few comments.

=================
No sound problem:
=================
Live CD --> everything's fine
Install --> fine
Restart --> install nvidia proprietary --> restart --> no sound!
200+ updates --> restart --> continuous whistle
Disable on board Audio card --> crappy sound, but something, at least.
Movieplayer and Rythmbox ask for additional codecs (to play wma and mp3). I let them download their codecs and reboot.
Still crappy sound (with rythmbox and vlc, no sound at all with movieplayer). See below for sound problem description and possible solutions.

=================
Useful output commands for audio/video troubleshooting
=================
uname -a
aplay -l
arecord -l
amixer -c 0

to check if the system recognizes the soundcard:
aplay -l
lspci -v | less

sounds module installed?:
find /lib/modules/`uname -r` | grep snd


===========
Comprehensive Multimedia & Video Howto
===========
enable medibuntu:
sudo wget http://www.medibuntu.org/sources.list.d/`lsb_release -cs`.list --output-document=/etc/apt/sources.list.d/medibuntu.list; sudo apt-get -q update; sudo apt-get --yes -q --allow-unauthenticated install medibuntu-keyring; sudo apt-get -q update
install all multimedia stuff:
sudo apt-get remove gnash gnash-common libflashsupport mozilla-plugin-gnash swfdec-mozilla && sudo apt-get install alsa-oss faac faad flashplugin-nonfree gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse ia32-libs ia32-sun-java6-bin icedtea6-plugin libmp3lame0 non-free-codecs openjdk-6-jre unrar
install gecko (for audio/video streaming in web browser):
sudo apt-get remove kaffeine-mozilla mozilla-helix-player mozilla-mplayer mozilla-plugin-vlc totem-mozilla xine-plugin
sudo apt-get install gnome-mplayer gecko-mediaplayer
reboot

audio conversion:
sudo apt-get install soundconverter audacity oggconvert
tag editor:
sudo apt-get install exfalso
Video conversion:
sudo apt-get install avidemux ffmpeg winff
DVD playback:
sudo apt-get install libdvdcss2 libdvdread4 libdvdnav4 vlc
alternative to VLC: sudo apt-get install gxine libxine1-ffmpeg
DVD rip
sudo apt-get install dvdrip
alternative: sudo apt-get install k9copy

Firefox add-ons:
NoScript (tick the box entitled "Temporarily allow top-level sites by default");
Screen resolution:
sudo xrandr -s 1280x800 (to set at 1280x/800)
sudo xrandr -q
Use the first command again and set the highest resolution that RandR claims is supported. Once that is set, try setting the resolution you know is correct, as it may now accept that resolution
==============

==============
Possible solutions or approaches to solve the sound issue
==============

Here after, a list of solutions that are reported to have worked at least ones:

1. kernel
check that grub is really starting the latest kernel (2.6.31-14-generic reported to work)
dpkg --get-selections | grep linux-image
uname -r
Edit your menu.lst file so that the kernel version numbers are up to date:
sudo gedit /boot/grub/menu.lst

2. check volumes or mute
gnome-alsamixer
or
alsamixer -Dhw (hw device should be specified)

3. pulseaudio fixes
backup and delete
$ mkdir ~/pulse-backup && cp -r ~/.pulse ~/.asound* /etc/asound.conf /etc/pulse -t ~/pulse-backup/
$ rm -r ~/.pulse ~/.asound*
$ sudo rm /etc/asound.conf
install libreries and utilities
sudo apt-get install libasound2-plugins padevchooser libsdl1.2debian-pulseaudio
purge libflashsupport
sudo apt-get remove --purge libflashsupport flashplugin-nonfree-extrasound
config pulsaudio device chooser (choose default output and input card)
$ pulseaudio & pavucontrol
check alsa PCM volume or mute
alsamixer -Dhw
Note: When the PulseAudio ALSA plugins are active, you must explicitly specify your hardware device in alsamixer (marked in blue above), otherwise it will open the PulseAudio mixer
4. alsa reinstall
backup as in previous item:
mkdir ~/pulse-backup && cp -r ~/.pulse ~/.asound* /etc/asound.conf /etc/pulse -t ~/pulse-backup/
remove alsa:
sudo apt-get --purge remove linux-sound-base alsa-base alsa-utils
shutdown and restart
reinstall alsa:
sudo apt-get install linux-sound-base alsa-base alsa-utils
sudo apt-get install gdm ubuntu-desktop
shutdown and restart
configure:
goto System > Preferences > Sound
goto Hardware tab and goto Profile:
Select "Analog Stereo Duplex"
5. upgrade alsa to 1.0.22
6. modem proprietario
(= switch it off from "Proprietary Driver" dialog)
answer to issued bug:
This problem has been temporarily resolved by disabling the proprietary Smart Link Software Modem driver available in Ubuntu's Hardware Drivers dialog (jockey-gtk).

7. remove pulseaudio
sudo apt-get remove pulseaudio


-----------------
EDIT: approach 4 made the trick and now sound works, even if not perfectly yet.
-----------------

Karmic Koala 64bit: almost fresh install

Fresh install of Karmic Koala, but keeping the previous /home partition unformatted.
Installation quite OK, but a few issues immediately arose.
Most important of which, several sound issues.

More detailed installation description in a later post.

As for now, the overall impression is that compared to 8.04 this Ubuntu release has several improvements, but it's missing loads details and functionalities which for sure would make at least a bad impression on new linux adepts, if not falling back on windows.

Monday, May 18, 2009

Fix a Frozen System with the Magic SysRq Keys

http://fosswire.com/post/2007/09/fix-a-frozen-system-with-the-magic-sysrq-keys/
It says:
You finally got your Linux environment to crash. Ctrl+Alt+Backspace does nothing [...]
The Linux kernel includes a secret method of restarting your PC should it ever stop doing its job.
  1. Hold down the Alt and SysRq (Print Screen) keys.
  2. While holding those down, type the following in order. Nothing will appear to happen until the last letter is pressed: REISUB
  3. Watch your computer reboot magically.
What the individual keys do in that sequence are not as important as
what it does as a whole: stops all programs, unmounts all drives, and
reboots. A lot safer than just cutting the power.

Here it is again: REISUB. Remember that, as it
will save you a lot of time when you are configuring a system and
something gets messed up. Need a mnemonic? Try Raising Elephants Is So Utterly Boring.


nix's note (09 Dec 2008):
Just some other additional notes: alt+print screen + REISUB = reboot alt+print screen + REISUO = shutdown

---------

See also:
http://en.wikipedia.org/wiki/Magic_SysRq_key:
The AltGr key, if present, can be used in place of Alt key in order to avoid alternative uses of these combinations such as Screenshot for Alt+SysRq+s under Gnome. It also can be accessed from the serial console
[...]
unRaw      (take control of keyboard back from X), 
tErminate (send SIGTERM to all processes, allowing them to terminate gracefully),
kIll (send SIGKILL to all processes, forcing them to terminate immediately),
Sync (flush data to disk),
Unmount (remount all filesystems read-only),
reBoot.

This can prevent a fsck being required on reboot and gives some programs a chance to save emergency backups of unsaved work.

Another common version of this mnemonic device is "Raising Skinny Elephants Is Utterly Boring", which performs the same task, but in an alternate order. There is debate regarding whether the Sync command should come earlier or later.

Wait a few seconds between each command. For example, many applications will do an emergency save on receiving SIGTERM, but if SIGKILL is sent too soon, the application will not have time. Likewise, the Sync and Unmount processes need a few seconds before the system is rebooted.



Thursday, April 16, 2009

PCLinuxOS 2009.1 installation

PCLinuxOS 2009.1 installation
Apr 08, 2009

My previous post on PCLinuxOS 2007 installation is here.

Upgrade attempt:

The instructions on the forum or website are not at all easy to find.
Actually I couldn't find a description of the upgrade procedure.
Luckily, our friend Google brought me here.
I've followed this simple guide, but the dist-upgrade command didn't complete: halfway up it started complaining that some packages couldn't be installed due to dependencies conflicting with other versions of the same dependency....

Probably there is a way out, but I was already prepared (=BACKUP important data!!!!) to a fresh install.
And here it goes.

Fresh install:

tot install time ~20min
tot personalization so far <0h10 style="font-weight: bold;">The notebook:
IBM ThinkPad T40
CPU intel pentium M 1300MHz
RAM 512MB
HD fujitsu 100GB
Sound max integrated digital audio from Analog Devices
video: ATI mobility radeon 7500 (32MB shared memory)
modem: agere system AC'97
infrared, LAN, 2 USB 1.1, docking station

BASE INSTALL

note: system is WinXP dual boot and when starting the installation, I forgot to fully switch off winXP and left it hybernated. Not a good idea!

old partitioning scheme:
hda1 (/winXP not automounted, ntfs) (85GB)
hda2 /boot ext3 (100MB)
hda3 /media/scambio fat32 (2GB)
hda5 /media/important ext3 (1GB)
hda6 / ext3 (11GB)
hda5 swap (1GB)

Before starting:
backup of sensitive data
backup of /home (just in case)
backup of netani.inf from /etc/ndiswrapper

I've accepted to "use existing partitions" during install, which didn't gave me the possibility of automounting hda1 and 3. And no way back possible, too (no "back" button, or similar).
So, if you need to mount partitions different from native linux FS, don't "use existing partitions"....!
I've got a hard shake when the systema asked me to install GRUB on hda1.
I've accepted quickly, for it is where it should be installed.
Immediatley after I realized that hda1 is where WinXP resides. And it was hybernated. Therfore not writeable. But pclos WAS actually writing!!! Result: grub has been installed with no problem and winXP resumed from hybernation with no issue.
Lucky me.
Next time I MUST remember not to leave an OS suspended when installing another OS...

Keyboard: UK
Time zone: Europe/Rome


after base install: ~2.5GB used space
TV card Dazzle ?, wireless PCMCIA Belkin Mimo not recognized

kernel: 2.6.26-8 (i586)

Feeling after first install:
Very similar to previous (2007) version.
Removed the eye-dazing dotted black background.
Horrible and awkward splashscreen with PCLOS logos in time....
Compiz Fusion has to be enabled, but it works out-of-the-box, with no need for (ATI) driver download.

mp3 audio works out of the box.
ntfs and fat32 partition read and write to be tested (not automanted during install, my mistake)

PERSONALIZATION

WiFi: setup through control center/network/wireless/ndiswrapper.
inf file used: netani.inf from the previous installation (in turn coming from netgear wpnt511 driver)
--> network working very fine and fast. WPA also OK.
Connection status icon is already in the panel (as opposed to pclos 2007)
Net switching applet was very bad in pclos 2007: it was not really changing connection to the desired SSID when needed. It was picking its own choice from the available SSID. Not very kind from it! Now it seems to work. In case, a simple (from root):

iwconfig wlan0 essid your_ssid_name

makes the magic.

Installed through synaptics (in different sessions):
note: no need to change or add respositories, everything works as it is.
note2: fastest from Milano seems the Swiss ftp repository

1. gcompris, gcompris-sounds-it, ktuberling
2. gramps, libdvdcss2
3. aspell-it, locales-it, mozilla-firefox-it, mozilla-thunderbird-it, myspell-it_IT, myspell-thes-it_IT, openoffice.org-l10n-it
3. timidity++, easytag, rosegarden
4. googleearth, kdegames-suite, ksudoku, skype, wesnoth
5. mercurial
6. lib-dvb

Fonts:
tbd
--> pclos control panel --> "install fonts" --> "import windows fonts" button.

Compiz:
As said, Compiz Fusion works out-of-the-box, with no need for (ATI) driver download.
It has to be enabled in the control center/hardware/3D effects dialog box.
Unfortunately, with Compiz enabled, some system dialogs are not visible.
For instance, the "root password request dialog" is an empty window and when typing nothing is shown (but it is actually typed because if you press ENTER it accepts it).
It can be just annoying or very bad, depending on which dialog is blankened...
I'll see in the future.

DVD play:

next:

TV tuner "Dazzle TV Hybrid Stick":

TV tuner testing:

Monday, January 12, 2009

HandBrake 0.9.3

Good news: this new version has a linux GUI available as well.
xBuntus debs can be found here.
Forum thread here.

Friday, June 1, 2007

mythTV e dazzle hybrid TV

http://mcentral.de/wiki/index.php/Em2880#Installation
http://forums.gentoo.org/viewtopic-p-4074690.html?sid=cfa6e502d15f032e1db15b3c1d3d744d
http://www.sabayonlinux.org/wiki/index.php?title=Setup_Mythtv
http://doc.ubuntu-fr.org/pctv_hybrid_pro_stick
http://eduard.caliu.cat/
https://wiki.ubuntu.com/em28xx

dmesg
2917.188000] Linux video capture interface: v2.00
[ 2917.251000] em28xx v4l2 driver version 0.0.1 loaded
[ 2917.251000] usbcore: registered new interface driver em28xx
[ 3276.384000] usb 1-3: USB disconnect, address 4
[ 3280.123000] usb 1-3: new high speed USB device using ehci_hcd and address 5
[ 3280.241000] usb 1-3: configuration #1 chosen from 1 choice

zagor@akira ~ $ sudo lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 002: ID 1241:1122 Belkin
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 005: ID eb1a:2881 eMPIA Technology, Inc.
Bus 001 Device 001: ID 0000:0000

Code:
sudo modprobe em28xx

zagor@akira ~ $ lsmod | grep em28
em28xx 45224 0
compat_ioctl32 2432 1 em28xx
ir_common 31108 1 em28xx
videodev 26624 1 em28xx
v4l2_common 23936 2 em28xx,videodev
v4l1_compa
t 13572 2 em28xx,videodev
tveeprom 15248 1 em28xx
i2c_core 21760 6 em28xx,tveeprom,i2c_i801,radeonfb,fb_ddc,i2c_algo_bit



/var/tmp/portage/media-tv/v4l-dvb-hg-0.1-r2/temp/build.log:

* Determining the location of the kernel source code
* Found kernel source directory:
* /usr/src/linux
* Found kernel object directory:
* /lib/modules/2.6.20-sabayon-r3/build
* Found sources for kernel version:
* 2.6.20-sabayon-r3
>>> Unpacking source...
* hg clone http://linuxtv.org/hg/v4l-dvb ...
abort: error: Name or service not known
 [ !! ]

!!! ERROR: media-tv/v4l-dvb-hg-0.1-r2 failed.
Call stack:
ebuild.sh, line 1614: Called dyn_unpack
ebuild.sh, line 751: Called qa_call 'src_unpack'
environment, line 4110: Called src_unpack
v4l-dvb-hg-0.1-r2.ebuild, line 47: Called mercurial_src_unpack
mercurial.eclass, line 77: Called mercurial_fetch
mercurial.eclass, line 54: Called die

!!! (no error message)
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/tmp/portage/media-tv/v4l-dvb-hg-0.1-r2/temp/build.log'.



EDIT: this link possibly best: 2nrds.com.
Card should be same as Pinnacle PCTV Hybrid Pro Stick (320e) (USB ID=eb1a:2881).
Card option could be (link for kernel 2.6.29):
53 -> Pinnacle Hybrid Pro
1 -> Unknown EM2750/28xx video grabber
52 -> DNT DA2 Hybrid



EDIT2: the latter link seems to work up to Hardy, maybe not on Intrepid http://ubuntuforums.org/showthread.php?t=956353
EDIT3: with kernel >2.6.24 see this article on HTPCpoint (in Italian)

EDIT4: from Pinnacle web page:


PCTV Hybrid Pro Stick (320e)






Dazzle*TV Hybrid Stick (320e)



EDIT5: latest resources found on installation:
OpenLinux (in Italian)

Tuesday, April 24, 2007

alimentatore silenzioso e media center

mi sono imbattuto in un sito che descrive come creare un media center linux, nel quale a un certo punto si descrive un alimentatore esterno. potrebbe tornare utile.


qui per comprare materiale elettronica che fa al caso del media center