Visit Jeremy's Blog.
Go Back > Blogs > Whaling the FOSS
User Name


The experiences of an Australian student who uses Linux.

Cover all topics from shell scripts to monopolies and reviews to political comments.
Rate this Entry

Losing your root filesystem

Posted 07-19-2011 at 03:06 AM by William (Dthdealer)

Linux is an interesting beast. By design it is modular, and so as a direct consequence it is very flexible. Its flexibility both on a large scale ( for example scaling for hardware ) and on a small scale ( what it can do ).

Operating systems such as Microsoft Windows however has been designed with a very narrow mindset. This 'target implementation' is a rough fathom of the average user's presumed work: documents, games, file management, etc. Although it would seem to cover most people, in reality it only covers most of the work of most people, meaning that the bulk of users eventually end up trying to perform ( or want to perform ) an action outside of the scope of writing documents or playing games.

Take for example trying to mount a USB drive with more than one partition. Microsoft had made Windows completely oblivious to the partitions of anything but internal harddrives, and so a user that has come across a multi-partition device would be stuck.

Ignoring that the Linux kernel supports storage device capabilities better in the first place, if it didn't in a 'stock form' then it could be modified to do so. Best of all, these modifications could then be merged back into the kernel so the whole world can enjoy them.

Yesterday I came across a good example of the flexibility of Linux. I had started a computer off a USB flash drive containing Debian and some basic disk utilities ( fdisk, parted, mkfs.* ) to repartition the host computer's main harddrive.

I planned to remove a partition and resize another to fill the whole device. Before I did this I had a quick glance at the partition I was about to delete, only to find some old movies that I wanted to keep. Unfortunately there was no space on the other partitions of the computer to copy them over, so I plugged a portable harddrive into the USB slot next to my USB stick.

Within seconds magic words appeared on screen denoting that the USB hub with both devices in it had failed ( probably due to an insufficient power supply ) and that my root filesystem ( on my USB stick ) no longer existed. I could have just used another USB port and rebooted the computer, but I decided to have a poke around at a system beheaded of its parts.

If this were Windows the computer would have locked up immediately, for this would be seen as out of the scope of its use and the programmers would not have bothered to write it in a better way. Yet I still had BASH loaded into memory and working, and a stable system.

Unfortunately the only command that could have spared 30 seconds of my life spent rebooting was 'mount' and it is not part of BASH and was not loaded into memory. I was able to access non physical directories ( such as /dev and /sys ) but the only really usable directory was my ramdrive ( /dev/shm on most systems ).

It struck me that this computer could probably run forever in this state. Shell scripts are more than enough of a language to write a simple text editor in, and this would do most of what a 'target computer user' would want. I could have probably piped keyboard input somehow into a file on the binary level so I could type out the binary code of the mount executable, but that is out of skills set

Has anyone else been in a similar situation before? What were your experiences?

Regards, William
Posted in Uncategorized
Views 2769 Comments 1
« Prev     Main     Next »
Total Comments 1


  1. Old Comment
    Not exactly the same, but I had a disk image that I intended to use with bochs on an OpenBSD host. The disk image was attached to my default bochs config that booted up a Gentoo minimal install CD (testing it out as the dev environment for my own OS that I'm working on). Anyways, I need to transfer some files over to the bochs image from OpenBSD, so I mounted the bochs image via vnd(4) after I formatted it to ext2.

    A bit later, forgetting that the disk was mounted in OpenBSD still, I booted up bochs and reformatted it.

    It had a strange effect on the host system. My CPU's started handling what appeared to be an interrupt storm and the system came to a crawl. It was still operational, but it was slow. It was a very weird experience that I'm not likely going to repeat haha.
    Posted 07-20-2011 at 04:43 PM by rocket357 rocket357 is offline


All times are GMT -5. The time now is 11:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration