LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need to identify the USB boot (http://www.linuxquestions.org/questions/linux-newbie-8/need-to-identify-the-usb-boot-929324/)

finekevin 02-14-2012 12:37 PM

Need to identify the USB boot
 
Hi,

I can boot my system either from SATA drive or USB drive by selecting in BIOS. The question is how do I detect whether I booted from USB or not. Is there any commands? I need this to automate my testing.

Thank you,
Kevin

cbtshare 02-14-2012 01:49 PM

If you booted from the USB you will see the usb blinking everytime you move the mouse to issue a command.Thats the simplest way I know of..

jefro 02-14-2012 03:27 PM

mount command may show which is mounted as sda. I'd think that sda would be the booted drive but there are some twists to that story too.

syg00 02-14-2012 03:59 PM

There is no way to know after the fact.
Maybe pass a dummy parameter to the boot, and check /proc/cmdline.

gwmorris 02-15-2012 11:10 AM

Hello everyone,

I don't want to intrude on the post, but I do have a similar issue I'm wondering about. I have a 500G external drive, mainly for backups, but I split it into two PRIMARY partitions before I wrote anything else to it. One was NTFS, as I had a WinDoze system before and wanted to back it up to its native filesystem. Now I'm wondering what would happen if I installed another Linux system on that drive, would it mess with anything (other than boot options), or could I just use GRUB and set it up there? I want to be able to boot into this installation of Fedora, but I'd like to install a different distro on the BIG drive and be able to boot it without losing any backups.

Actually, I had considered (but only considered) trying to install Win again on the NTFS partition, but again I don't know how that would work or affect the existing system. Anyone with experience doing this, I'd appreciate a little advice or info!

Thanks.

MrUmunhum 02-15-2012 03:56 PM

Quote:

Originally Posted by gwmorris (Post 4603135)
Hello everyone,

I don't want to intrude on the post, but I do have a similar issue I'm wondering about. I have a 500G external drive, mainly for backups, but I split it into two PRIMARY partitions before I wrote anything else to it. One was NTFS, as I had a WinDoze system before and wanted to back it up to its native filesystem. Now I'm wondering what would happen if I installed another Linux system on that drive, would it mess with anything (other than boot options), or could I just use GRUB and set it up there? I want to be able to boot into this installation of Fedora, but I'd like to install a different distro on the BIG drive and be able to boot it without losing any backups.

Actually, I had considered (but only considered) trying to install Win again on the NTFS partition, but again I don't know how that would work or affect the existing system. Anyone with experience doing this, I'd appreciate a little advice or info!

Thanks.

I'm assuming by 'external drive' you mean a USB drive?

The best way to repartition any drive is to use Gparted. I use a live CD myself but you can use the one that comes with Fedora to alter an external drive.

I would not reinstall Winder$, I don't trust M$ to not wipe out my existing systems!

Yes, Grub is your friend. I have an old 'How To' that is very popular at: http://64.124.13.3/hacks/USB_Boot_using_GRUB.html

Again, get a live CD for Super Grub, it will help you recover from weird things.

gwmorris 02-16-2012 06:42 AM

Quote:

Originally Posted by MrUmunhum (Post 4603394)
I'm assuming by 'external drive' you mean a USB drive?

The best way to repartition any drive is to use Gparted. I use a live CD myself but you can use the one that comes with Fedora to alter an external drive.

I would not reinstall Winder$, I don't trust M$ to not wipe out my existing systems!

Yes, Grub is your friend. I have an old 'How To' that is very popular at: http://64.124.13.3/hacks/USB_Boot_using_GRUB.html

Again, get a live CD for Super Grub, it will help you recover from weird things.

Yes, USB. I figured that would be assumed due to the nature of the post. The partitioning is already done, as for splitting the drive. I used whatever was there at the time, and I know all about setting up the filesystem for Linux with /boot and /home, etc. and whatever you want to keep separate, so that's no big deal. All I'm wanting to know is if I can install a different distro on the BIG 500G USB (or 250G ext4) drive and be able to boot into it, but not mess with this install or disable it somehow. I've done quite a few multi-boot systems, mixing Win and Linux, Win and VMS, and the like, but never tried this on an external drive like that, nor have I ever tried two Linux distros at the same time. All I want to do is be sure that if I try it there's nothing serious that I need to do or consider. I have WINE, it's just not the greatest for some tasks and difficult to configure. I've even considered seeing if there is a way to run a true Windows as an emulation, but haven't looked into it much yet.

Thanks.


All times are GMT -5. The time now is 07:39 AM.