Live USB Linux hibernate/freeze on USB unplug - linux

I want to replicate a feature that exists on Windows To Go solution into Ubuntu Linux (https://technet.microsoft.com/en-us/library/jj592680.aspx#wtg_faq_surprise)
If the Windows To Go drive is removed, the computer will freeze and the user will have 60 seconds to reinsert the Windows To Go drive. If the Windows To Go drive is reinserted into the same port it was removed from, Windows will resume at the point where the drive was removed. If the USB drive is not reinserted, or is reinserted into a different port, the host computer will turn off after 60 seconds.
This means: I run Linux on an USB Stick, and I want it to freeze if I accidentally unplug the USB. And if I reconnect it, Linux will detect it and return to work. Can anyone point some directions to perform that?
Thanks in advance!

I am guessing thats going to be more difficult then you think, the linux kernel and other systems need to know to not panic when it happens. Windows is probably set up better for boot drive failure.

Related

Can I recover files from corrupt Raspberry Pi sd?

I have a Raspberry Pi sd card that I'd really hoping I can get files off. I the sd card mounts in my Mac and I have a boot0 and RECOVERY under in the Mac devices menu. I can navigate the sd content on my Mac.
When I try to boot up the RPi with the sd card I get part way through the boot process then a flood of not normal text. Then it ends with "Fixing recursive fault but reboot in needed!" I had this twice now and the first time i waited about 5 minutes before shutting down. This time I am leaving it for about 30 minutes in hopes that another message comes up and it says Fixed or something else.
If I can navigate the card on my Mac what should I do next assuming it is not going to boot? Can I get to files on my Desktop? It is one folder in particular I would love to recover.
The RPi is a 2 version B.
I am not sure why this is not more documented but I found a solution. I have Googled for a hour easy trying to find a solution and literally looked at 100 sites of what other did. Nothing worked for me.
Here is what I ended up doing. I have another RPi around so I booted that up. Inserted the sd can into a reader. plugged the reader into the other RPi and boom! I have full access to the file system. I accessed my Desktop folder and the www folder. Moved the files over for what I needed to recover.
This was crazy easy so I sure hope other find this post and try this first before all the crazy instructions out there.

LittleBits Arduino doesn't work on Linux

I recently received a LittleBits Arduino Coding Kit and thought the Arduino IDE would immediately recognize it.
I noticed that when I choose the "Arduino Leonardo" on the Tools -> Board as the instruction video said to do, the Tools -> Serial Port menu is grayed out.
I have already added myself to the "dialout" and "uucp" groups, ran the "arduino" program as root, ran a whole bunch of commands dealing with permissions, restarted the computer, plugged it into all the ports, reinstalled the drivers, and tried everything else I came across. For some reason, I can't figure out how to get this to work.
I use Xubuntu on an i686 architecture by the way, if that even matters.
I think you don't have permissions to read/write the serial port device. Even running Arduino application as root, it's running on a Java JVM, and calls other programs to compile sketches and burn the board... it's hard to figure out what's happening in the background. Also, is not a good idea to run programs as roout unless necessary.
Try this. First list your serial port devices.
ls -l /dev/tty*
There's should be one called /dev/ttyUSB0 or /dev/ttyACM0 or something like that (not /dev/ttySx). That one is your Arduino. Add read/write permissions for every user to that device file.
sudo chmod 666 /dev/ttyUSB0
Use the device you have. Now run the Arduino IDE, if the issue is with permissions, then it's done. Unfortunately, you'll have to do this every time you unplug the board or reboot the system.

Jetson TK1 booting issues

Received my Jetson TK1 yesterday. After unboxing it and configuring the Linux GUI, rebooting the device with a mouse (cordless) attached to its USB 3.0 port takes it to some sort of Command line page where it probably loads some files and then the screen starts printing " [ . ] ". Nothing happens beyond that until I restart the board without any USB peripheral and then the device boots into the normal Linux GUI. Unable to figure out what's wrong with my board and why is it not working properly.(I am a newbie to LINUX)
P.S.: Connecting the monitor via HDMI after switching on the device gives no visual output, just a blank screen. Is it possible to connect the device via network adapter for remote access even it the screen is running blank?
The question is quite old, but as some people might get frustrated with it, I'll provide the answer for most probable cause.
Upgrading the board running 19.X release causes libglx.so to be corrupted. The issue have been actively discussed on NVIDIA forums and the best way to solve it is to upgrade to 21.X.
Otherwise, you can try recovering the libglx.so in the usr/lib/xorg/modules/extensions/ from Tegra124_Linux_R19.3.0_armhf.tbz2.
Could you possibly provide a bit more information about your situation.
Are you able to go to command mode by pressing 'CTRL+F1' or 'CTRL+ALT+F1'?
If that works, it means your Jetson operating system is working but only the GUI is not working properly.
Yes, You can use ssh to your Jetson (what I do) if only the GUI of Jetson is broken and your OS is working properly. Note that in order to do so you need to know ip address of your Jetson and perform some possible router configuration.
Note: Sometimes if you have a USB device connected to your system (jetson), the jetson might mistakenly assume the USB is storage type and therefore tries to boot up from the USB. This leads to failure since it can not load any OS of the USB. (I'm not sure if this is the case for you)

How can we use Linux from a small storage pen drive? Does it work on micro-controllers also?

I generally hear that LINUX OS can be downloaded on flash, pen drive (floppy disk?) etc. How we can do that?
I have RHEL 5.4 source code - so how can download it into pen drive and how much space is required?
What other functionality I can add apart from the OS - so that when I boot from that storage device I can make use of them?
Can we download Linux OS into micro-controllers also?
I generally hear that LINUX OS can be downloaded on flash, pen drive (floppy disk?) etc. How > we can do that?
If you can't get it to work on your own, you can buy a ready made Linux on a USB drive from
a site like http://www.osdisc.com or http://www.cheapbytes.com
Not all PCs, especially older PCs, can boot from the USB Drive. Even some newer PCs are beginning to ship with security features that can interfere with booting code. When it does work, you have to find out the proper way to boot the USB drive. You might have only a few seconds during reboot to enter the right key, or it will boot Windows (if Windows is installed). The key to get to the BIOS Boot Menu might be delete or escape or F10 or some other key (varies with PC motherboard manufacturer). A message on the screen that flashes by rather quickly might mention keys you can press. Boot to a specific device or changing boot order can also often be found in the BIOS setup.
There is a linux utility called unetbootin that will create a USB drive that will boot linux. It does not create a USB boot drive from a source code distribution, but rather from an ISO file representing a live CD or the live CD itself.
Since large USB drives (e.g. 32GB) are relatively inexpensive, if you want to compare systems or have multiple systems there is a way to have multiple linux and other operating systems on one USB drive and be able to choose which to boot into. See, for instance, http://www.pendrivelinux.com/ which has a wide variety of procedures for making a bootable USB using either windows or Linux to set up the USB and booting a variety of systems.
I have RHEL 5.4 source code - so how can download it into pen drive
and how much space is required?
RHEL 5.4 is a bit old. You need the Live CD, if there was one.
The ISO file can take up 600+MB. You want space left over to use the system. 2GB for the pen drive is OK. Sometimes you can get by with less.
What other functionality I can add apart from the OS - so that when I
boot from that storage device I can make use of them?
Upon boot the operating system will often recognize sound cards, other usb devices, the hard drives, etc. You need to know how to use these things within Linux, and how to enable them if they are not configured. Some Linux distributions have a place to put packages that are to be autoinstalled when a USB pen drive based system initializes. In this way you can "install" software from the distribution archives that are not included on the standard live system, even if you don't have internet access.
Can we download Linux OS into micro-controllers also?
People run it on raspberry pi and such, but the versions of Linux on non-PC hardware that has low memory are often quite tiny compared to a desktop version. They can be tiny enough to be challenging to work with or expand.

linuxmint installation error from USB?

I had made a USB installation using linuxmint-13-mate-dvd-64bit.iso. Then I run it inside from windows 7 and intalled it. After when I reboot the linuxmint is a giving an arror like this
(initramfs) losetup: could not find any free loop device
in the prompt (intramfs) I can type "help" command.
But I am not a linux user, so I dont know which should be used ? Please help to me solve this issue ? Thanks in advance.
The words "USB" and "linux iso" you mentioned lead me to think you did this: you put that iso in the usb flash stick in a way to make it BOOTABLE (like a live cd), or, you TRIED to do that.
To make sure you usb flash stick is really bootable, you should really try to boot from usb stick.
Now, this is what (i think) you should do, and what you did.
What you should do, with the bootable usb stick:
Boot from usb, and click "install on Hard disk" or whatever linux mint has inside it, after succesfully booted the linux SO;
What you did:
Booted windows and used the files inside usb stick, prepared for "loop mount", to install linux.
Hope this helps.

Resources