Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Mounting a drive automatically

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
geoffb
Posts: 122
Joined: 2005-10-19 18:09
Location: Calgary, AB

Mounting a drive automatically

#1 Post by geoffb »

The following is my /etc/fstab, with irrelevant lines removed:

Code: Select all

/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       /home           ext3    defaults        0       2
/dev/sda1       /storage        ext3    defaults        0       2
/ and /home mount automatically on boot. I'd like for /storage to mount automatically as well, but I need to execute `# mount /storage` in order to link to the drive. How do I get /storage to mount automatically?

I'm running Debian 3.1 on the 2.6.12-1-686-smp kernel (not necessarily relevant, but included for verbosity).

geoffb
Posts: 122
Joined: 2005-10-19 18:09
Location: Calgary, AB

Re: Mounting a drive automatically

#2 Post by geoffb »

geoffb wrote:The following is my /etc/fstab, with irrelevant lines removed:

Code: Select all

/dev/hda1       /               ext3    defaults,errors=remount-ro 0       1
/dev/hda5       /home           ext3    defaults        0       2
/dev/sda1       /storage        ext3    defaults        0       2
/ and /home mount automatically on boot. I'd like for /storage to mount automatically as well, but I need to execute `# mount /storage` in order to link to the drive. How do I get /storage to mount automatically?

I'm running Debian 3.1 on the 2.6.12-1-686-smp kernel (not necessarily relevant, but included for verbosity).
Would it be logical to just write up a bash script:

Code: Select all

#! /bin/sh
#
mount /storage
...and just put this in /etc/rc1.d (or whichever folder it should go in) with SUID set?

anon

#3 Post by anon »

does dmesg tell you anything?

geoffb
Posts: 122
Joined: 2005-10-19 18:09
Location: Calgary, AB

#4 Post by geoffb »

anon wrote:does dmesg tell you anything?
The following is what it displays which looks relevant (nothing removed).

Code: Select all

Probing IDE interface ide0...
hda: Maxtor 6B250R0, ATA DISK drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: PIONEER DVD-RW DVR-108, ATAPI CD/DVD-ROM drive
hdd: HL-DT-ST GCE-8525B, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
Probing IDE interface ide2...
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
hda: max request size: 1024KiB
hda: 490234752 sectors (251000 MB) w/16384KiB Cache, CHS=30515/255/63, UDMA(100)
hda: cache flushes supported
 /dev/ide/host0/bus0/target0/lun0: p1 p2 < p5 p6 >
kjournald starting.  Commit interval 5 seconds
EXT3-fs: mounted filesystem with ordered data mode.
Adding 4883720k swap on /dev/hda6.  Priority:-1 extents:1
EXT3 FS on hda1, internal journal
hdc: ATAPI 63X DVD-ROM DVD-R CD-R/RW drive, 2000kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
hdd: ATAPI 52X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)
SCSI subsystem initialized
Linux agpgart interface v0.101 (c) Dave Jones
nvidia: module license 'NVIDIA' taints kernel.
ACPI: PCI Interrupt 0000:01:00.0[A] -> GSI 16 (level, low) -> IRQ 177
NVRM: loading NVIDIA Linux x86 NVIDIA Kernel Module  1.0-7174  Tue Mar 22 06:44:39 PST 2005
kjournald starting.  Commit interval 5 seconds
EXT3 FS on hda5, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
ACPI: PCI Interrupt 0000:02:05.0[A] -> GSI 22 (level, low) -> IRQ 185
ACPI: PCI Interrupt 0000:02:05.0[A] -> GSI 22 (level, low) -> IRQ 185
eth0: Yukon Gigabit Ethernet 10/100/1000Base-T Adapter
      PrefPort:A  RlmtMode:Check Link State
libata version 1.11 loaded.
ata_piix version 1.03
ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 18 (level, low) -> IRQ 169
PCI: Setting latency timer of device 0000:00:1f.2 to 64
ata1: SATA max UDMA/133 cmd 0xEFF0 ctl 0xEFE6 bmdma 0xEF90 irq 169
ata2: SATA max UDMA/133 cmd 0xEFA8 ctl 0xEFE2 bmdma 0xEF98 irq 169
ata1: dev 0 cfg 49:2f00 82:7c6b 83:7b09 84:4003 85:7c69 86:3a01 87:4003 88:207f
ata1: dev 0 ATA, max UDMA/133, 160086528 sectors:
ata1: dev 0 configured for UDMA/133
scsi0 : ata_piix
ata2: SATA port has no device.
scsi1 : ata_piix
  Vendor: ATA       Model: Maxtor 6Y080M0    Rev: YAR5
  Type:   Direct-Access                      ANSI SCSI revision: 05
SCSI device sda: 160086528 512-byte hdwr sectors (81964 MB)
SCSI device sda: drive cache: write back
SCSI device sda: 160086528 512-byte hdwr sectors (81964 MB)
SCSI device sda: drive cache: write back
 /dev/scsi/host0/bus0/target0/lun0: p1
Attached scsi disk sda at scsi0, channel 0, id 0, lun 0

lacek
Posts: 764
Joined: 2004-03-11 18:49
Location: Budapest, Hungary
Contact:

#5 Post by lacek »

Just some thoughts:
It seems your problem is that the device driver for sda1 loads after the devices already mounted. So you definitely need an init script for this, this is the easiest way to solve this problem.
Init scripts are needless to make SUID root, the SUID bit is ignored when set for scripts. Init script run as root anyway.

Post Reply