FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 02-04-2010, 10:05 PM
Ian Forde
 
Default Mount USB disk at startup?

On Thu, 2010-02-04 at 14:19 -0800, Kenneth Porter wrote:
> --On Thursday, February 04, 2010 8:36 AM -0600 Robert Nichols
> <rnicholsNOSPAM@comcast.net> wrote:
>
> > Looks like that's about all you can do. USB devices aren't available
> > until hotplug discovers them, and that's proceeding in parallel with the
> > rest of the boot sequence. Be sure to put a timeout in that loop lest it
> > hang forever if that external device is absent.
>
> Even better would be to make the script event-driven and launched by the
> hotplug process. Then there's no busy-wait.
>
> This page has some info:
>
> <http://linux.die.net/man/8/hotplug>
>
> The detail links on this page aren't working for me but look promising:
>
> <http://linux-hotplug.sourceforge.net/>
>

Since the OP is looking to have their USB drive mounted before mythtv's
backend process starts up, I'd recommend disabling the mythbackend
startup script:

chkconfig mythbackend off

Then doing a manual mount in /etc/rc.local, followed by starting
mythbackend.

/sbin/mount /dev/sdb1 /wherever
/sbin/service mythbackend start

Of course, I wouldn't recommend using a USB drive for storing myth
recordings, as it eventually bite you due to USB2's limited bandwidth...

-I (also a mythtv user!)

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-05-2010, 03:43 PM
John Doe
 
Default Mount USB disk at startup?

From: Ian Forde <ianforde@gmail.com>
> On Thu, 2010-02-04 at 14:19 -0800, Kenneth Porter wrote:
> > --On Thursday, February 04, 2010 8:36 AM -0600 Robert Nichols
> > > Looks like that's about all you can do. USB devices aren't available
> > > until hotplug discovers them, and that's proceeding in parallel with the
> > > rest of the boot sequence. Be sure to put a timeout in that loop lest it
> > > hang forever if that external device is absent.
> > Even better would be to make the script event-driven and launched by the
> > hotplug process. Then there's no busy-wait.
> Since the OP is looking to have their USB drive mounted before mythtv's
> backend process starts up, I'd recommend disabling the mythbackend
> startup script:
>
> chkconfig mythbackend off
>
> Then doing a manual mount in /etc/rc.local, followed by starting
> mythbackend.
>
> /sbin/mount /dev/sdb1 /wherever
> /sbin/service mythbackend start
>
> Of course, I wouldn't recommend using a USB drive for storing myth
> recordings, as it eventually bite you due to USB2's limited bandwidth...
>
> -I (also a mythtv user!)

Hum... hoping in in the middle of the conversation but...
I am mounting a usb disk through fstab; and the daemon (bacula) using it never complained...
Aren't the filesystems mounted (rc.sysinit?) before most daemons...?
Otherwise, just create a mounting init script with a starting priority lower than mythbackend.

JD



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-05-2010, 11:34 PM
Robert Nichols
 
Default Mount USB disk at startup?

John Doe wrote:
> From: Ian Forde <ianforde@gmail.com>
>> On Thu, 2010-02-04 at 14:19 -0800, Kenneth Porter wrote:
>>> --On Thursday, February 04, 2010 8:36 AM -0600 Robert Nichols
>>>> Looks like that's about all you can do. USB devices aren't available
>>>> until hotplug discovers them, and that's proceeding in parallel with the
>>>> rest of the boot sequence. Be sure to put a timeout in that loop lest it
>>>> hang forever if that external device is absent.
>>> Even better would be to make the script event-driven and launched by the
>>> hotplug process. Then there's no busy-wait.
>> Since the OP is looking to have their USB drive mounted before mythtv's
>> backend process starts up, I'd recommend disabling the mythbackend
>> startup script:
>>
>> chkconfig mythbackend off
>>
>> Then doing a manual mount in /etc/rc.local, followed by starting
>> mythbackend.
>>
>> /sbin/mount /dev/sdb1 /wherever
>> /sbin/service mythbackend start
>>
>> Of course, I wouldn't recommend using a USB drive for storing myth
>> recordings, as it eventually bite you due to USB2's limited bandwidth...
>>
>> -I (also a mythtv user!)
>
> Hum... hoping in in the middle of the conversation but...
> I am mounting a usb disk through fstab; and the daemon (bacula) using it never complained...
> Aren't the filesystems mounted (rc.sysinit?) before most daemons...?
> Otherwise, just create a mounting init script with a starting priority lower than mythbackend.

There lie the perils of jumping in late. The issue was not with mounting, but
rather the boot-time fsck, which occurs earlier.

--
Bob Nichols "NOSPAM" is really part of my email address.
Do NOT delete it.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-10-2010, 11:26 PM
Jobst Schmalenbach
 
Default Mount USB disk at startup?

There is a kernel option you can give to solve
this problem, in /boot/grub/grub.con add to the end
of the kernel line:

rootdelay Xs

where x is the amounty of time to wait before
/root is mounted, however this is valid for
everything else as well.

play with X until you get it right.

Jobst



On Thu, Feb 04, 2010 at 02:15:25PM +0100, Mogens Kjaer (mk@crc.dk) wrote:
> I have a CentOS 5 machine with an external 500G USB disk,
> formatted with JFS.
>
> How do I get this to mount automatically at boot time?
>
> If I add to /etc/fstab:
>
> /dev/sdb1 /var/video jfs defaults 1 2
>
> fsck.jfs complains at boot time:
>
> Error: Cannot open device /dev/sdb1
>
> Usage: fsck.jfs ...
>
> ...
>
> Give root password for maintenance
> ...
>
> If I log in with the root password, /dev/sdb1
> is present, and I can run
>
> fsck.jfs -f /dev/sdb1
>
> without problems. After ctrl-D it reboots, and gives
> the above error again.
>
> I have to log in as root, remount,rw / and remove
> the /dev/sdb1 line from /etc/fstab to get it to boot.
>
> The problem is not related to JFS; it occurs with
> an external ext3 file system as well.
>
> How do I mount /dev/sdb1 automatically at boot?
>
> Mogens
>
> --
> Mogens Kjaer, Carlsberg A/S, Computer Department
> Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
> Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
> Email: mk@crc.dk Homepage: http://www.crc.dk
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos

--
Diplomacy: The art of saying, "Nice Doggy," until you can find a stick.

| |0| | Jobst Schmalenbach, jobst@barrett.com.au, General Manager
| | |0| Barrett Consulting Group P/L & The Meditation Room P/L
|0|0|0| +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-11-2010, 07:44 AM
Mogens Kjaer
 
Default Mount USB disk at startup?

On 02/11/2010 01:26 AM, Jobst Schmalenbach wrote:
>
> There is a kernel option you can give to solve
> this problem, in /boot/grub/grub.con add to the end
> of the kernel line:
>
> rootdelay Xs
>
> where x is the amounty of time to wait before
> /root is mounted, however this is valid for
> everything else as well.
>
> play with X until you get it right.

I've tried changing grub.conf into:

default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-164.11.1.el5.centos.plus)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.11.1.el5.centos.plus ro
rootdelay=200 root=LABEL=/
initrd /initrd-2.6.18-164.11.1.el5.centos.plus.img
title CentOS (2.6.18-164.11.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-164.11.1.el5 ro rootdelay=200 root=LABEL=/
initrd /initrd-2.6.18-164.11.1.el5.img

but there's no delay at all (the "kernel" lines may have wrapped,
they are on one line in the file).

The kernel source has:

static unsigned int __initdata root_delay;
static int __init root_delay_setup(char *str)
{
root_delay = simple_strtoul(str, NULL, 0);
return 1;
}
...
__setup("rootdelay=", root_delay_setup);

and later:
if (root_delay) {
printk(KERN_INFO "Waiting %dsec before mounting root
device...
",
root_delay);
ssleep(root_delay);
}

The message "Waiting 200sec before mounting root device..." is never
printed.

Putting rootdelay= after root= makes no difference.

Strange...

Mogens

--
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
Email: mk@crc.dk Homepage: http://www.crc.dk
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 02-11-2010, 10:38 PM
Jobst Schmalenbach
 
Default Mount USB disk at startup?

Rather weird, could be that the delay is too long, it should be more like 10!

http://codtech.com/wiki/index.php/CULT:_Kernel_command_line_parameters#rootdelay

I have had a similar problem ... on one server I use USB backup disks
which I swap on a regular base. On the occasion when I had to reboot
it halted with the fsck not being able to check it ... so I put
it in and nver looked back.


Jobst



On Thu, Feb 11, 2010 at 09:44:41AM +0100, Mogens Kjaer (mk@crc.dk) wrote:
> On 02/11/2010 01:26 AM, Jobst Schmalenbach wrote:
> >
> > There is a kernel option you can give to solve
> > this problem, in /boot/grub/grub.con add to the end
> > of the kernel line:
> >
> > rootdelay Xs
> >
> > where x is the amounty of time to wait before
> > /root is mounted, however this is valid for
> > everything else as well.
> >
> > play with X until you get it right.
>
> I've tried changing grub.conf into:
>
> default=0
> timeout=5
> splashimage=(hd0,0)/grub/splash.xpm.gz
> hiddenmenu
> title CentOS (2.6.18-164.11.1.el5.centos.plus)
> root (hd0,0)
> kernel /vmlinuz-2.6.18-164.11.1.el5.centos.plus ro
> rootdelay=200 root=LABEL=/
> initrd /initrd-2.6.18-164.11.1.el5.centos.plus.img
> title CentOS (2.6.18-164.11.1.el5)
> root (hd0,0)
> kernel /vmlinuz-2.6.18-164.11.1.el5 ro rootdelay=200 root=LABEL=/
> initrd /initrd-2.6.18-164.11.1.el5.img
>
> but there's no delay at all (the "kernel" lines may have wrapped,
> they are on one line in the file).
>
> The kernel source has:
>
> static unsigned int __initdata root_delay;
> static int __init root_delay_setup(char *str)
> {
> root_delay = simple_strtoul(str, NULL, 0);
> return 1;
> }
> ...
> __setup("rootdelay=", root_delay_setup);
>
> and later:
> if (root_delay) {
> printk(KERN_INFO "Waiting %dsec before mounting root
> device...
",
> root_delay);
> ssleep(root_delay);
> }
>
> The message "Waiting 200sec before mounting root device..." is never
> printed.
>
> Putting rootdelay= after root= makes no difference.
>
> Strange...
>
> Mogens
>
> --
> Mogens Kjaer, Carlsberg A/S, Computer Department
> Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
> Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
> Email: mk@crc.dk Homepage: http://www.crc.dk
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos

--
People who fight may lose. People who do not fight have already lost. - Bertolt Brecht

| |0| | Jobst Schmalenbach, jobst@barrett.com.au, General Manager
| | |0| Barrett Consulting Group P/L & The Meditation Room P/L
|0|0|0| +61 3 9532 7677, POBox 277, Caulfield South, 3162, Australia
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 10:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org