r/funny • • Feb 21 '11

Watson: Linux Basics

Post image
2.2k Upvotes

480 comments sorted by

View all comments

Show parent comments

274

u/[deleted] Feb 22 '11 edited Feb 22 '11

The joke is supposed to be that the final Jeopardy question effectively forced Watson, which runs on Linux, to use the Linux command to format its hard drive. Ever tried telling somebody in a video game online that you can get an awesome hack by pressing Alt + F4 (the Windows shortcut to quit a program, i.e., the game)? Yeah, this is the same thing.

However, the person who made this didn't actually know the Linux command to format the filesystem, so they Googled it, found a wrong answer, and used it. Fsck is the Linux utility to check a filesystem - filesystemcheck. The -f flag is the Linux flag to "force" the utility to run, and -y is the Linux flag to automatically answer "yes" to any prompts; i.e., in theory, the person thought that the utility would have said "Are you SURE you want to do this," and specifying the -y flag would automatically reply yes before you realized what you were doing. /dev/hdb1 is an example of how Linux addresses hard drives, but as others have pointed out, it's unlikely that Watson's operating system would be housed on that partition. The Linux equivalent of Windows' "C" drive (which is almost always the primary partition of the first attached drive) is /dev/hda1. The number at the end of the designation is the logical partition of the drive. It's additionally unlikely that a supercomputer like Watson would have only one logical partition, as it is a cluster.

"Sudo rm -rf /" would be the proper command to format the root file system in Linux. Sudo is the Linux command to perform a command as a SuperUser (the Linux equivalent of an Admin), rm is the name of the delete utility ("remove") and the -rf flags are "recursive," and "force," respectively. "/" is how the operating system is addressed in Linux; it is the root of the entire OS partition. Specifying the recursive flag means that you will delete every single file on the OS partition, and because you performed the command as a superuser AND forced it to run, the utility will run until it deletes enough system files for the OS to no longer be operable. The Windows equivalent of the command would be "deltree c:\ /y," where deltree is "delete tree," "c:" is almost always the root of the OS partition, and "/y" automatically responds "yes" to any questions, i.e., "You should really say No right now, but say yes if you're a sadomasochist or an idiot."

Edit: Listen to the guys below me. I often colloquially refer to a format as a total delete of files (if you've ever installed Windows, this is all the "Quick Format" option does). Rm -rf / is the Linux equivalent of a Windows "Quick Format;" which is to say, it's not actually a format at all. Mkfs (Make Filesystem) is the correct Linux utility to totally format a hard drive / partition.

48

u/darkshine Feb 22 '11

Correct me if I am wrong, but isn't the proper reformat command mkfs /dev/hda1?

5

u/Phrodo_00 Feb 22 '11

yeah, if you want to use ext2 (most likely, you don't) you can use mkfs.format or mkfs -t format. You could also directly use the utilities of each format which have varied names (mkreiserfs, mke2fs, etc...)

22

u/captainAwesomePants Feb 22 '11

Journals are just diaries, and diaries are for girls. ext2 all the way!

25

u/RiotingPacifist Feb 22 '11

rm wouldn't do a real format for that you need mkfs.

e.g

yes | mkfs -T ext2 $(mount | grep "/ " | cut -d" " -f1)
→ More replies (1)

9

u/quackdamnyou Feb 22 '11

"Sudo rm -rf /" would be the proper command to format the root file system in Linux.

Actually, that would just delete all the files. I think "formatting" implies deleting everything including the filesystem metadata, and also making the drive ready to use. The command on Linux would be "mkfs", but I don't actually know if it will work if there's an existing filesystem, so you might need to use "fdisk" to re-create the partition.

1

u/cybercobra Feb 22 '11

Pretty damn sure it'll work. You might be asked to confirm though, and you'll need to unmount the existing FS first.

4

u/CatullusSixteen Feb 22 '11

I like that. Your use of "sadomasochist" there implies that you would both enjoy the pain that comes with clearing your computer of files (masochist) and derive pleasure from wrecking your computer's shit (sadist).

1

u/noahboddy Feb 22 '11

If he would be both giving and receiving the pain--doesn't that mean he is his computer?

2

u/kelvie Feb 22 '11

Actually mkfs is the equivalent of a Windows "Quick Format"

The equivalent to a full format would be mkfs followed by

dd if=/dev/zero of=/dev/sda

2

u/noahboddy Feb 22 '11

I'm probably confused, so forgive me, but if you output zeroes directly to the block device, wouldn't that overwrite even the meta-stuff on the drive, like the master boot record, resulting in a drive that wasn't formatted at all?

1

u/kelvie Feb 22 '11

Whoops, yeah, you're right. It's the other way around

0

u/[deleted] Feb 22 '11

[deleted]

1

u/[deleted] Feb 22 '11

Watson normally has a pretty GUI. Think Gerty from Moon. The joke is one of two things, which is up for debate:

  1. The person who made this thought that the humans got the answer correct, even though he didn't have them specify the correct answer. Watson also got the answer correct, effectively causing it to format itself and crash.

  2. As happened most times, the humans got the answer wrong, but Watson got the answer correct, resulting in the same outcome.

0

u/[deleted] Feb 22 '11

[deleted]

1

u/[deleted] Feb 22 '11

You know this didn't actually happen...right?

0

u/[deleted] Feb 22 '11

[deleted]

1

u/[deleted] Feb 22 '11

That's kind of central to the joke.

1

u/dogweather Feb 22 '11

Yeah. Not bad, actually. :-P

1

u/dogweather Feb 22 '11

I think I need to get my brain checked.

3

u/MrWoohoo Feb 22 '11

However, the person who made this didn't actually know the Linux command to format the filesystem

It has been pointed out the creator of the joke intentionally made the humans get the answer wrong. Watson, as usual, beats the humans but with disastrous (and funny) results.

1

u/semarj Feb 22 '11

Little bit of trivia I thought I'd like to pass along

sudo is actually SubstituteUserDO

'execute this command as a user that is not me'

it takes a user argument (-u) which defaults to root (so it usually just does what you want)

but say for example you are root, but root doesn't have access to postgres

root~$ sudo -u postgres dropdb users

1

u/enginuitor Feb 22 '11

sigh.

"Sudo rm -rf /" would be the proper command to format the root file system in Linux

The rm command doesn't "format" anything. It removes file entries.

"/" is how the operating system is addressed in Linux

...?

→ More replies (4)