ubuntu - Questions about behaviour of running LiveCD Linux after unmounting a CD-ROM

05
2014-04
  • user277216

    Could anyone explain what happens in system after unplugging CD-ROM during working with LiveCD session?

    Suppose that I'm using Ubuntu LiveCD and suddenly by accident the CD-ROM disconnect for a matter of second because of for example power outage in the case of external devices or just opening the CD tray if the OS allows to do it. Assume that after a while the CD-ROM is pluged in again.

    Can anyone explain what exactly happens then, why the OS stops or rather is working but not as before it and how, if it's possible, the stability and usefullness can be brought back and user can continue working with?

    According to my observations based on Ubuntu LiveCDs (versions under 12, the kernel version is probably 2.6.XX) the system reaction is like following:

    • all applications in X desktop disappear (I think it's due to automatic sending a kill signal to all processes as if the OS wanted to shut down but actually it seems to wait for something) and it looks like only the background image with the cursor which can be moved all the time
    • all TTYs are avaible and can be displayed but there are only error messages there like INFO: task <process name>:<pid> blocked for more than 120 seconds and SquashFS error: unable to read [...]
    • all the time I can see blinking '_' and I can type something but pressing enter just make it skipped to the new line and obviously the OS doesn't execute it
    • terminal's shortcuts for canceling and quit current process also don't work
    • magic SysRq combinations are generally working and I can see the actual output but I don't know which of them would be useful in this case

    Can anyone explain this reaction and tell what exactly these errors mean? And what can one do then to fix it - is there any way for that and why not, if so?

    Here: http://unix.stackexchange.com/questions/76166/what-does-info-task-xxx-blocked-for-more-than-120-seconds-exactly-mean-on-lin I've just read that "if a task is blocked, it waits for resources to become available again". So if I got it correctly it's waiting for resources - is it true or just wrong interpretation and it will wait endlessly - CD-ROM is surely pluged in again as fast as possible. How to understand it?

    I know that processes are gone (or "blocked" as error messages are suggesting?), but how about files in the ramdisk, are they still there untill reboot? Is this possible to access them somehow? Or for example just extract text strings and so on?

    There is a magic SysRq shourtcut which remount filesystems - are there any chances that it would help in such situations or should be tried eventually at the end after other trials? If the CD are working as virtual fs, what effects can bring remountig filesystems in that case?

  • Answers
  • new123456

    I'll take a stab at a few of the errors:

    • SquashFS error: unable to read [...] is an error when trying to access the file-system on the CD itself. SquashFS, as Wikipedia notes, is a compressed read-only file-system often used for system data on LiveCDs. Most of your system directories (probably /bin, /sbin, and a few others) are probably on these CD file-systems, so when a program has to access these directories, you get an error.
    • <process name>:<pid> blocked for more than 120 seconds is probably due to some process wanting to read something from a SquashFS and the kernel blocking it because it gets a read error.
    • The blinking _ is either normal (that is, Ubuntu doesn't run a getty on whatever TTY you're using - I get one by pressing Ctrl+Alt+F8 on a perfectly normal system). However, if it's on a lower TTY (anything below TTY 7), that's probably an indication that Ubuntu can't start the login program because it can't find it. However, if you can type something that means that you probably have a getty running.
    • SysRQ has many possible options - Wikipedia gives a helpful list. You can try Alt+SysRQ+u to see if Linux can successfully remount the SquashFS file-systems that you lost when the CD was removed. If it works, you should be able to get a shell again - although I don't know if any other of your processes will recover.

    One thing you should try is to see what directories are associated with these read-only file-systems. To do this, you should try mount | grep squashfs. This will find out what file-systems are stored on the disk, and what will be affected when you remove it.

    As for recovering files in RAM - they persist until reboot, but if you can't remount the file-system and get access to a login shell, they're almost certainly going to be clobbered when you reboot.


  • Related Question

    Building a custom Linux LiveCD
  • hmp

    I need to create a small custom live system (for teaching a programming class). What would be the best way to do it?


  • Related Answers
  • Gren

    You can use Remastersys to build an Ubuntu or Debian distro of your own. For a fast live cd, I would install XUbuntu into a virtualbox vm and install the necessary programs and set it up to your liking. Then you can run remastersys backup and burn the resulting ISO to CDs for your students.

  • sudesh

    If you want to build your own distribution, Try Linux From Scratch (LFS). It is a project that provides you with step-by-step instructions for building your own custom Linux system, entirely from source code. http://www.linuxfromscratch.org/

    There are a lot of lightweight linux distributions available. Most of these can boot from LiveCD. http://lightlinux.blogspot.com/2008/06/top-10-of-lightweight-linux%5F24.html

  • emgee

    http://www.livecdlist.com/frontpage?order=value%5F1&sort=desc

    This website is a list of all the Live CD distros with a ranking given by the users

    I suggest you go with XUbuntu for programming purposes

    If you are looking to use it for server tests try open SUSE

  • Alon Swartz

    How about Morphix? http://www.morphix.org/ - includes a page on "Building a new LiveCD in two commands"!