Monday, March 4, 2019

ubuntu - File System Performance in Linux and Windows

I have built a HTPC with AMD Athlon 5350, which was completely sufficient. The system was running Windows 10 running in SSD and big HDD for backups in NTFS. Somehow there is a problem with network transfer speeds between PCs - with Samba I can get speeds up to 100 MB/s in my local network and FTP transfers which I would prefer don't get more than 10 MB/s. No idea why.


Anyway, I decided to build a new PC using Dell 7010 with 3470s. I plan to transfer the backup HDD.


The question is, which setup to choose.


I would prefer to switch to Ubuntu as I was always running Virtual Linux Machines on my previous computer. The question is - how will the NTFS HDD behave if I stay with Linux? Will it limit the transfer speeds? Will it consume lots of CPU when writing/reading? Should I try to reformat the HDD to Linux native FS?


Thanks!

Sunday, March 3, 2019

Added 2x DIMMs to Linux system but not seen in Total Memory

I had an old PC with Arch Linux



$ uname -a
Linux desktop 4.1.4-1-ARCH #1 SMP PREEMPT Mon Aug 3 21:53:10 UTC 2015 i686 GNU/Linux



with 2GB RAM. I've added 2x1Gb DDR2 DIMMs and now the system has DIMMs in all banks (4x1GB). The new memory is detected in the BIOS:



System Memory Available  4024 MB


And also the output of lshw shows all the slots populated with 1GB DIMM



But the Total Memory in /proc/meminfo shows only 2GB:



$ grep MemTotal /proc/meminfo 

MemTotal: 2058968 kB


I've tried to edit the kernel params in GRUB and add mem=4G, but the total memory remains 2GB.



Any ideas what else to try?

macos - How can I create a hotkey to play/pause Pandora on OS X?



I'm on OS X and want to have a hotkey (e.g. Cmd-Opt-P) to play/pause Pandora. I've used Butler to set one up for iTunes, but can't find a comparable solution for Pandora. I'm open to any solution (including apps, AppleScripts, etc.) that would allow me to bind a hotkey to play/pause, and I'm willing to use a paid solution as well. What can I do?





Solutions I've looked into and/or tried:




  • Pandora Boy: but the keyboard shortcuts don't seem to work for me, despite following the instructions here.

  • The official Pandora One player: according to the comments on this Pandora blog post, it doesn't support hotkeys.




My system:





  • OS X 10.6.6

  • Each of the various truly-modern browsers

  • Flash 10.1


Answer



Open Automator, select the "Service" template. Configure (at the top) the service to receive no input in any application. On the left in Library » Utilities, double-click the Run AppleScript action to add it to the service. Paste the following code:



tell application "PandoraBoy" to playpause



Press Cmd-S to save and name it "Play/Pause Pandora".






Open System Preferences » Keyboard » Keyboard Shortcuts » Services, select "Play/Pause Pandora" from the list and click to its right so an input field appears. Press your desired shortcut.


ubuntu - Why my Chrome freezes when I try to paste long texts?

Every time I try to paste a long text that I copied from some applications (like Vim or using xsel) my Google Chrome freezes, after some time it responds again but the text is not pasted.


Around 60 lines is enough to make it hang. If I paste the text first in Text Editor and copy it from there, the paste in Chrome happens with no problem.


With short texts I have no problems.


This is happening on Ubuntu 18.04 and Google Chrome 75.0.3770


Using xsel I tried with the primary and the clipboard selection and neither of those works. What selection is Text Editor using then? Why does it work when copied from there?

windows 7 - Can't run command prompt "Run as Admin"

I'm not able to open an elevated command prompt in Windows 7 Ultimate. Previously I was able to open such a command prompt in one of the following ways:




  • Start > type "cmd" then hit Ctrl + Shift + Enter

  • Start > type "cmd" then right click "cmd" and select Run as Administrator.



However when I try this now I only get a normal command prompt without administrator rights.




Any ideas what could be wrong, and how I could fix it?

partitioning - Recovering Ext3 Partition After Failed Move


I had an 1.5TB exteral disk, with an 983.83 GB ext3 partition on it, where the partition was positioned such that there were approximately 400 GB free space before the ext3 partition.


I then used Minitool Partition Wizard to move the partition to the start of the drive, but unfortunately the cable was ripped out from the drive at 54% completion.


Now the drive simply shows an unknown partition where the ext3 partition used to be.


I had a look at the situation using Partition Wizard's Partition Recovery, and it detects the an ext3 partition at the new location, as well as an unknown partition at the old location.


Since I have moved the partition to the start of the drive I suspect that it would be possible to continue the process in some way, the partition overlap, but there should be a sufficient offset between the locations, such that all the data should still be on the disk, though it is cut in two parts.


I have two ideas to how to fix the problem, but I'm not sure how I would make it happen.


The first idea is to simply copy the rest of the partition to the new location and then undelete the partition, such that it would show up again. It seems it would be the easiest way to fix the problem.


The second idea was to recover the partition at the new location, and then resize the partition to fill the entire drive and finally try to undelete the files, but I'm not sure this is even possible.


Does anyone of you have a good idea of how one of these ideas could be accomplished?


Alternative ideas to recover the partition would also be greatly appreciated.


EDIT: Clarified information about partition size and overlap.


Answer



OK, I don't know minitool, so I'll assume that it does the obvious thing: copy bytes sequentially and adjust metadata, either up front or afterwards.


You can use fdisk -l to see what state your partition table is in. It should either report a partition at the old location, or at the new location. Things might be easiest for you if you were to recover the partition in the location the metadata indicates.


You write that “there should not be any of the actual data which have been overwritten”. Does that mean that the whole partition is smaller than 400GB, in other words, that the old and the new location do not overlap? If so, you may skip the rest of this answer.


Otherwise I'd try to work out the offset of the move: by what distance were your sectors supposedly copied? The recovery output should give you a good indication there. If you have that worked out, I'd try to search for some overlap: using dd you can read arbitrary portions of your drive content. Do so at two locations exactly that offset apart from one another, and pipe the result to some hash function like md5sum. If your offset is correct, and the lower location contains bytes already copied while the higher location contains the source of those same bytes before copying, then the data and hence the hash should agree. In that case, you could simply copy the remaining data using the same offset, in order to either complete or undo the transfer, depending on the intended location of the recovered data which you have decided on above.


To what extent is size a factor in SSD performance?

To what extent is the size of an SSD a factor in its performance?



In my mind, correct me if I'm wrong, a bigger SSD should be, everything else being equal, faster than a smaller one. A bigger SSD would have more erase blocks and thus more leeway for the FTL (flash translation layer) to do garbage collection optimization. Also there would be more time before TRIM became necessary. I see on Wikipedia that it remarks that "The performance of the SSD can scale with the number of parallel NAND flash chips used in the device" so it seems throughput also increases significantly. Also many SSDs contain internal caches of some sort and presumably those caches are larger for correspondingly large SSDs.



But supposing this effect exists, I would like a quantitative analysis. Does throughput increase linearly? How much is garbage collection impacted, if at all? Does latency stay the same? And so on. Would the performance of a 8 GB SSD be significantly different from, for example, an 80 GB SSD assuming both used high quality chips, controllers, etc?




Are there any resources (webpages, research papers, presentations, books, etc) that discuss correlations between SSD performance (4 KB random write speed, latency, maximum sequential throughput, etc) and size? I realize this does not really sound like a programming question but it is relevant for what I'm working on (using flash for caching hard drive data) which does involve programming.



If there is a better place to ask this question, eg a more hardware oriented site, what would that be? Something like the equivalent of stack overflow (or perhaps a forum) for in-depth questions on hardware interfaces, internals, etc would be appreciated.

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...