Computing desk | ||
---|---|---|
< May 27 | << Apr | May | Jun >> | May 29 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
I have a relatively new laptop harddrive that has what looks like a single bad sector (8 x 512 blocks = 4KB, which coincidentally lies on a sector boundary (divisible by 32) and our article mentions is the modern size of a sector). This particular sector's unable to be read or written to, and that includes using low level OS utilities like dd (unix). It lies inside an NTFS formatted partition. I tried to use the Windows 7 disk check utility to repair it, but it would, I think, randomly restart when it hit that sector. The process takes quite a while too so it's not something I could test all the possibilities for easily.
My question is, shouldn't the checkdisk utility mark the file in NTFS' bad block list, and move on? (data recovery is not an issue here)
Second, I've tried writing to this sector a number of times with low level utilities. Isn't this all it should take for the drive to reallocate the sector? That hasn't seemed to prompt that. I ran some SMART utilities on it (smartctl) and if testing the particular region it did find the errors, but still no reallocation.
Any insight on this issue would be helpful. Thanks. Shadowjams (talk) 01:37, 28 May 2011 (UTC)
I have recently acquired an external HDD (1 TB). Everything was all lovely-jubbly until I used UNetBootIn to install Ubuntu 11.04 on a 100GB partition I had placed on the HDD. Now, it is not recognized at all by Vista. The entire HDD. What should I do to make it recognize the drive, and, can I get my data back..... ? --KägeTorä - (影虎) (TALK) 01:25, 28 May 2011 (UTC)
'Pre-existing partition before I created the Ubuntu partition'? No, there wasn't one. It's an external HDD, and I created a 100GB partition on that drive. Before doing this, I was able to access the drive from Windows (via a USB cable), but now, the drive does not even show up - all of it, and not just the Ubuntu partition, which I expected not to show up, because Ubuntu does stuff like that. --KägeTorä - (影虎) (TALK) 08:07, 28 May 2011 (UTC)
/dev/sda1: UUID="3A704EB7704E7A21" TYPE="ntfs" /dev/sda2: LABEL="HP_RECOVERY" UUID="D28E5A388E5A14F7" TYPE="ntfs" /dev/sda5: UUID="fdfa46a7-0252-4b2f-bf95-c3e95c110fec" SEC_TYPE="ext2" TYPE="ext3" /dev/sda6: UUID="63bb042c-32c5-4c33-b74b-75e6b1b6aada" TYPE="swap" /dev/sdb1: UUID="e0c623f9-bd91-4757-ac4f-56058e8e666d" TYPE="ext2"
ext2 is the partition I made with the Ubuntu installation (which I am writing from now). What I am wanting is that the other 900GB on the HDD (complete with 100GB of stuff I have put on it) show up in Vista, so I can access it from Vista. I am not bothered about not being able to access the Ubuntu partition from Vista. I would be able to do that in my own way, if the drive were visible in Vista, which it isn't. KägeTorä - (影虎) (TALK) 07:42, 28 May 2011 (UTC)
Ah, yes, in hindsight, it was at the beginning of the disk. So.... I need to reformat. All the info that's on the disk itself is stuff I still have on windows, so it's no big deal. Just means I have to reformat the disk. Now.... how do I do that when Vista is not even recognizing its existence? --KägeTorä - (影虎) (TALK) 08:44, 28 May 2011 (UTC)
/sbin/cfdisk /dev/sdb
and see what it says. --Trovatore (talk) 08:57, 28 May 2011 (UTC)/sbin/cfdisk
to create an NTFS partition in the second 100GB on the disk (it'll be /dev/sdb2). Then you can go into Disk Administrator in Windows and format that for NTFS. That way you don't lose your Ubuntu partition. --Trovatore (talk) 08:59, 28 May 2011 (UTC)That sounded like the idea I needed. However, all I get is:
FATAL ERROR: Cannot open disk drive Press any key to exit cfdisk
I'm lost. --KägeTorä - (影虎) (TALK) 09:04, 28 May 2011 (UTC)
/sbin/cfdisk /dev/sdb2
when what I should have typed is /sbin/cfdisk /dev/sdb
. If that's not it, then I'm afraid I don't know. --Trovatore (talk) 09:12, 28 May 2011 (UTC)
sudo
in front of it. --Trovatore (talk) 09:13, 28 May 2011 (UTC)
cfdisk (util-linux-ng 2.17.2)
Disk Drive: /dev/sdb Size: 1000204886016 bytes, 1000.2 GB Heads: 255 Sectors per Track: 63 Cylinders: 121601
Name Flags Part Type FS Type [Label] Size (MB) ------------------------------------------------------------------------------ Pri/Log Free Space 1.05* sdb1 Boot Primary Linux ext2 100000.00* sdb2 Boot Primary Linux 900201.23*
[ Bootable ] [ Delete ] [ Help ] [ Maximise ] [ Print ] [ Quit ] [ Type ] [ Units ] [ Write ] Delete the current partition
--KägeTorä - (影虎) (TALK) 09:27, 28 May 2011 (UTC)
sudo mkdir /media/sdb2
sudo mount /dev/sdb2 /media/sdb2
sudo mkntfs /dev/sdb2
to make an NTFS filesystem (="format" in Windows terminology), which should then show up in Windows. Or, after writing the partition table, you could reboot into Windows and open up Disk Administrator (it's in the control panel -- you might have to install it), look for the second partition on the disk, and format it from there. --Trovatore (talk) 09:41, 28 May 2011 (UTC)
Thanks, Trovatore, you've been a star! All fixed now! --KägeTorä - (影虎) (TALK) 10:28, 28 May 2011 (UTC)
A co-worker of mine on another shift has taped a data matrix type bar code onto the cabinet over his desk. Is there a way to find out what it is the code for? Can I scan it with my smartphone somehow? If not for curiosity, I'd like to know so that I can let a little air out of his smugness. Dismas|(talk) 01:39, 28 May 2011 (UTC)
Hi there folks, I'm a neophyte with regular expressions and need some pointers. What I'm trying to get is a regex expression that matches ((Extra album cover)) when there is no cover displayed (either the field has no data or the image name is commented out). I've tried
And this broke my brain to create this version. I want it to match a string that starts "((Extra album cover" has "| Cover = " in it (variable number of spaces) had has no uncommented image name between the = and the )) closing the template. Even a version that matches the case when there is only whitespace between the Cover = and a following | or )) would be good. I'd love help if possible thanks - Peripitus (Talk) 11:15, 28 May 2011 (UTC)
{
and |
are special characters, so you need to escape them.\{\{Extra album cover[^}]+\|\s+Cover\s+=\s+(?:\|[^}]*)?))
(untested). I can't do the general case because I don't know the full grammar of MediaWiki articles. My impression is that it's a horrible mess, and mw:Markup_spec/BNF seems to bear that out. Perl regex syntax is also a nightmare. In theory, a completely correct regex probably exists, but good luck finding it. -- BenRG (talk) 19:39, 28 May 2011 (UTC)This regex, in Javascript,
\{\{[Ee]xtra album cover[^}]*\|\s*[Cc]over\s*=\s*(<!--.*-->)?\s*[\|}]
matches all of the following:
((Extra album cover | cover = )) ((Extra album cover | asdfasdf | cover = | foo = bar)) ((Extra album cover | asdfasdf | cover = <!-- myfile.jpg --> )) ((Extra album cover | asdfasdf | cover = <!-- myfile.jpg --> | foo = bar)) ((extra album cover|cover=)) ((extra album cover|cover=<!--myfile.jpg-->|foo=))
and does not match
((Extra album cover | asdfasdf | cover = myfile.jpg | foo = bar))
You may need to use a multi-line flag like "m" since the templates are often written on multiple lines. Note that the above does not match the empty template ((Extra album cover)) or cases where the "cover" attribute is not already there. IANE. Riggr Mortis (talk) 23:49, 28 May 2011 (UTC)
I've been re-organising my home office and found a copy of Half-life 2 that my Father in Law gave to me - I fancy a quick blast but remembered that steam games can only be registered once? If I tried to install it, it will fail right? --Cameron Scott (talk) 11:39, 28 May 2011 (UTC)
More adventures in my home office (see above) - I have found my Windows 7 Disc - I want to make a copy of it so that if the original gets scratched I have a copy - what's the easiest way to do it? --Cameron Scott (talk) 11:43, 28 May 2011 (UTC)
I'm having trouble checking my email using Thunderbird. My email is a Yahoo BT account (you know, the one that BT says they will give you for free, even though Yahoo accounts are free anyway). Thunderbird is suddenly telling me that my password is wrong. So, using the browser to login to my free BT Yahoo account, using the password I have been using for two years, I am able to change the password to a new passoword - and then inputting this brand new password into Thunderbird, I get the same message telling me the password is wrong. Can anyone help out here? --KägeTorä - (影虎) (TALK) 13:24, 28 May 2011 (UTC)
-- Edit - doesn't matter. Sorted it out. --KägeTorä - (影虎) (TALK) 14:08, 28 May 2011 (UTC)
This question was originally posted on the help desk [1] - I moved it over here. Chzz ► 15:55, 28 May 2011 (UTC)
I Love the game, I am hooked but now I have Windows XP and cannot play the Game. My question is there an up to date version of the game or a patch so I can play the version I have? If I have to purchase the game again, so be it, unless there is a down load that would be to quote Tony the Tiger GREAT!!!!! So I hope you can help or steer me to the right Phone # or E-Mail to get the mission accomplished. Please hurry because again I Love the game....Terry — Preceding unsigned comment added by 69.129.254.212 (talk) 15:52, 28 May 2011 (UTC)
I issue the following PyWikipedia command:
C:/pywikipedia/add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always
Which works, but also produces this messy screen output:
Messy screen output 1
|
---|
unicode test: triggers problem #3081100 Loading User:StuRat/X MOVE...
>>> User:StuRat/X MOVE <<< + + MOVE_X1=1
WARNING: Your account on wikipedia:en does not have a bot flag. Its edits will be visible in the recent changes and it may get blocked. Sleeping for 7.6 seconds, 2011-05-28 17:17:43 Updating page User:StuRat/X MOVE via API Pausing 9 seconds due to database server lag. Updating page User:StuRat/X MOVE via API I would like to pare that down to this: Sleeping for 7.6 seconds, 2011-05-28 17:17:43 Pausing 9 seconds due to database server lag. |
So, I tried redirecting the output to a file, like so:
C:/pywikipedia/add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always > junk.txt
But this was the result:
Messy screen output 2
|
---|
Loading User:StuRat/X MOVE...
>>> ♥{lightpurple}User:StuRat/X MOVE♥{default} <<< ♥{lightgreen}+♥{default} ♥{lightgreen}+♥{default} MOVE_X1=1 WARNING: Your account on wikipedia:en does not have a bot flag. Its edits will be visible in the recent changes and it may get blocked. Sleeping for 7.5 seconds, 2011-05-28 18:38:44 Updating page User:StuRat/X MOVE via API Pausing 9 seconds due to database server lag. Updating page User:StuRat/X MOVE via API |
Other than somehow messing up the color changes, this didn't seem to do anything beyond suppressing the first print line. So:
1) How can I suppress all the screen prints ?
2) How can I suppress all the prints except those containing (or better yet, starting with) the words "Sleeping" or "Pausing" ? StuRat (talk) 22:48, 28 May 2011 (UTC)
> nul
(if you're using cmd.exe or 4NT) or > /dev/null
(if you're using a Cygwin shell such as bash).| grep -P "^Sleeping|^Pausing"
(if you have GNU grep installed). Unfortunately, the output lines may be delayed significantly, because most programs will buffer their output in large chunks if they aren't writing to a TTY/console, and the pipe to grep
is not a TTY/console.2>&1
to redirect stderr to stdout. This has to go before the pipe symbol (|
). -- BenRG (talk) 00:18, 29 May 2011 (UTC)I tried adding "> nul", like so:
C:/pywikipedia/add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always > nul
I got this result:
Messy screen output 3
|
---|
Loading User:StuRat/X MOVE...
>>> User:StuRat/X MOVE <<< + + MOVE_X1=1 WARNING: Your account on wikipedia:en does not have a bot flag. Its edits will be visible in the recent changes and it may get blocked. Sleeping for 7.7 seconds, 2011-05-28 23:05:11 Updating page User:StuRat/X MOVE via API Pausing 9 seconds due to database server lag. Updating page User:StuRat/X MOVE via API |
I tried adding in "2>&1", like this:
C:/pywikipedia/add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always 2>&1
This was the screen output:
Messy screen output 4
|
---|
unicode test: triggers problem #3081100 Loading User:StuRat/X MOVE...
>>> User:StuRat/X MOVE <<< + + MOVE_X1=1 WARNING: Your account on wikipedia:en does not have a bot flag. Its edits will be visible in the recent changes and it may get blocked. Sleeping for 7.7 seconds, 2011-05-28 23:10:11 Updating page User:StuRat/X MOVE via API |
So neither one of those worked. I seem to have grep, but it's not working for me. First I tried this grep:
C:/pywikipedia/add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always | grep -P "^Sleeping|^Pausing"
Which produced this error:
'C:' is not recognized as an internal or external command, operable program or batch file.
I then tried the grep along with "2>&1":
C:/pywikipedia/add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always 2>&1 | grep -P "^Sleeping|^Pausing"
This produced no output at all, and, judging from how quickly the prompt came back, the command didn't execute. So, it looks like that got the same error, but suppressed it. What am I doing wrong ? StuRat (talk) 03:22, 29 May 2011 (UTC)
>nul
; you need to write 2>&1 >nul
. The third and fourth failed because you used forward slashes in the executable path, which are being interpreted as command-line options. Use backslashes. I don't know why the forward slashes work when you don't pipe to grep
, but generally they won't work. -- BenRG (talk) 06:27, 29 May 2011 (UTC)OK, I changed the slashes as follows:
C:\pywikipedia\add_text.py -page:User:StuRat/X_MOVE -text:"\n MOVE_X1=1\n" -always 2>&1 | grep -P "^Sleeping|^Pausing"
It then complained "Error: Invalid option -P", so I took out the "-P" (but left in the rest of the grep). That worked ! What was the "-P" supposed to do, anyway ? StuRat (talk) 10:33, 29 May 2011 (UTC)
|
for alternatives, some other syntaxes use \|
instead, and I didn't want to deal with differences in backslash handling in different shells. You have an older or off-brand grep with fewer options. I don't know why |
alone still worked. Maybe I'm wrong about the default grep syntax, which I never use. -- BenRG (talk) 17:06, 29 May 2011 (UTC)