r/funny • • Feb 21 '11

Watson: Linux Basics

Post image
2.2k Upvotes

480 comments sorted by

View all comments

Show parent comments

1

u/jetpacktuxedo Feb 22 '11

But I am pretty sure that you would have to unmount the file system to format it. You can't do anything without a file system mounted. Therefore, this could never happen.

1

u/[deleted] Feb 22 '11

I... what?

I don't know if linux prevents writing to raw devices while they are mounted, but even if it does, we're talking about putting a file system onto a disk, which you do on the device anyway. You have to format it before it can be mounted in the first place.

1

u/jetpacktuxedo Feb 22 '11

There are quite a few operations that won't execute unless the device is unmounted. Resizing partitions is one that I know only works when unmounted. Not positive on what else, but I would imagine formatting wouldn't work.

1

u/[deleted] Feb 22 '11

Why does it matter whether it's mounted or not? Even if you actually can't format it without unmounting it... then unmount it.

1

u/jetpacktuxedo Feb 22 '11

If the OS is running from that device then you can't unmount it, because you can't unmount it while it is in use. If the OS is running from something else then who gives a fuck if you reformat it?

Unless you boot to a different device, wipe and reformat, and then remove the device then it wouldn't work.

1

u/[deleted] Feb 22 '11

If the OS is running from that device then you can't unmount it, because you can't unmount it while it is in use.

This is not strictly true but it's a good rule of thumb.

If the OS is running from something else then who gives a fuck if you reformat it?

Well, I mean, if you're adding storage to a system, you'll want to format those disks...

1

u/jetpacktuxedo Feb 22 '11

But you couldn't crash anything (like Watson supposedly did in the picture) by doing that. An "rm -rf /" or a dd would get you that sort of screen, I think, but I've never tried so I wouldn't really know.

1

u/[deleted] Feb 22 '11

Oh, well, I think you would be able to scribble over the disk even while it's mounted, which would have pretty much the same effect. I doubt whether it would panic the kernel.

1

u/jetpacktuxedo Feb 22 '11

Fair enough.