LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-21-2007, 01:59 AM   #1
nitinbaldi
LQ Newbie
 
Registered: Sep 2006
Posts: 12

Rep: Reputation: 0
Detect usb stick at boot


Can anyone help me on how to make my usb stick detected at boot time.
I need a file to be detected at the boot-up which is in the usb stick.
I came to know that I will have to make a device node and load some modules in the init file of the initrd.
Can anyone suggest how to make a device node for my usb stick (/dev/sda) in the init and which all modules
are needed to be loaded and how?
I am using fedora core 5.

Here is my fstab file
---------------------------------------------------------------------------
LABEL=/1 / ext3 defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
tmpfs /dev/shm tmpfs defaults 0 0
LABEL=/home/user1 /home/user1 ext3 defaults 1 2
LABEL=/home/user2 /home/user2 ext3 defaults 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs defaults 0 0
LABEL=SWAP-hdd2 swap swap defaults 0 0
/dev/hdd5 /mnt/c vfat defaults 0 0
/dev/hdd6 /mnt/d vfat defaults 0 0
/dev/sda /mnt/e vfat defaults 0 0


And Here is my init file
---------------------------------------------------------------------------
#!/bin/nash

mount -t proc /proc /proc
echo > /proc/suspend2/do_resume
setquiet
echo Mounting proc filesystem
echo Mounting sysfs filesystem
mount -t sysfs /sys /sys
echo Creating /dev
mount -o mode=0755 -t tmpfs /dev /dev
mkdir /dev/pts
mount -t devpts -o gid=5,mode=620 /dev/pts /dev/pts
mkdir /dev/shm
mkdir /dev/mapper
echo Creating initial device nodes
mknod /dev/null c 1 3
mknod /dev/zero c 1 5
mknod /dev/systty c 4 0
mknod /dev/tty c 5 0
mknod /dev/console c 5 1
mknod /dev/ptmx c 5 2
mknod /dev/rtc c 10 135
mknod /dev/tty0 c 4 0
mknod /dev/tty1 c 4 1
mknod /dev/tty2 c 4 2
mknod /dev/tty3 c 4 3
mknod /dev/tty4 c 4 4
mknod /dev/tty5 c 4 5
mknod /dev/tty6 c 4 6
mknod /dev/tty7 c 4 7
mknod /dev/tty8 c 4 8
mknod /dev/tty9 c 4 9
mknod /dev/tty10 c 4 10
mknod /dev/tty11 c 4 11
mknod /dev/tty12 c 4 12
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67
echo Setting up hotplug.
hotplug
echo Creating block device nodes.
mkblkdevs
echo "Loading jbd.ko module"
insmod /lib/jbd.ko
echo "Loading ext3.ko module"
insmod /lib/ext3.ko
mkblkdevs
resume LABEL=SWAP-hdd2
echo Creating root device.
mkrootdev -t ext3 -o defaults,ro hdd8
echo Mounting root filesystem.
mount /sysroot
echo Setting up other filesystems.
setuproot
echo Switching to new root and running init.
switchroot
 
Old 03-21-2007, 04:34 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
a normal usb stick has no bootloader in the mbr so if your bios detects it...it ignores it.

2) you can follow the suggestions in my signature if you want a bootable usb stick....but it is not clear to me that is your true aim.....is there some driver you want at boot due to a problem with your current distro?

3 it may be the case that FC6 is updated for your driver if that is the issue?
 
Old 03-21-2007, 06:27 AM   #3
nitinbaldi
LQ Newbie
 
Registered: Sep 2006
Posts: 12

Original Poster
Rep: Reputation: 0
Actually I am using suspend2 to hibernate the system. In this, I create a file in which the snapshot of the memory is stored and then the system power downs. While resuming, that file is read and its contents are restored in the memory.
Now I have created above mentioned file in the usb stick. I want that when the system boots, initially the grub will be displayed. Then I choose the appropriate entry and load the kernel. At here, I want that the usb be detected and the file be loaded.
So summarizing, I want the usb stick to be detected at the boot time, after the grub stage i.e at the time when init loads. Hope this is sufficient...
 
Old 03-22-2007, 04:07 AM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
why not use the swap file to have the hiberante/resume file?

2) well the thing is...I think .... we are not talking about a bios boot issue at all...we are simply have a hard drive in suspend mode...and your usb stick should already have been read and accessed for the file to be written



is that clearer?


3) boot time suggests you have rebooted or shutdown and down a cold boot and I think you mean something completely different
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Flash stick boot yosemite Linux - Software 3 03-07-2007 01:27 PM
Unable to boot Usb stick freykatt Puppy 4 02-03-2007 08:34 AM
Network boot from USB stick uanderss Linux - General 1 05-21-2006 08:14 AM
mount does not detect a vfat filesystem in my usb stick ernesto_cgf Linux - Hardware 3 12-07-2005 07:19 AM
USB Stick boot KrYpToN Linux - Hardware 5 10-08-2003 08:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:24 PM.

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