# What do you have in fstab?

## decrease789

What do you have in your fstab? Any strange devices? Do they work?

I have a usb caddy which I wish to mount using fstab. Although I can not mount it until after coldplug has started!!! How can I get it to mount usb when reading fstab. I also have a sd card reader writer which I would like to mount as swap.

I want to mount the hard drive caddy as /var. How can I mirror /var onto the hard drive caddy so it will work?

I use 2.6 kernel with udev. I have usb/ata and usb mass storage compiled into my kernel.

----------

## yaneurabeya

What is your entire USB device configuration in the kernel? Also, if you plug stuff in does your system detect the devices (look at dmesg output and then look at your lsusb output). We can go more in depth in terms of your /proc files, but dmesg *should* display the /dev/ node mapping I would think.

Oh, and if the issue is dealing with your ordering of services, then just make coldplug a boot service and have it run prior to your mounting your drives. Not sure if you can pull it off the mounting before /var and swap are required though...Last edited by yaneurabeya on Tue Mar 08, 2005 12:18 pm; edited 1 time in total

----------

## patlefox

Hi,

Did you have a look at 

http://www.gentoo.org/doc/en/udev-guide.xml

----------

## decrease789

i already have it in the boot runlevel. how do i move to before the drives are mounted? i do not know how to do that. like i said it works fine. it mounts fine. i just can't mount it using fstab at boot. use i have followed the guide.... yes it detects stuff plugged in cat /proc/bus/usb/devices gives....

```
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  4 Spd=12  MxCh= 0

D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1

P:  Vendor=067b ProdID=3507 Rev= 0.01

S:  Manufacturer=Prolific Technology Inc.

S:  Product=ATAPI-6 Bridge Controller

S:  SerialNumber=1A1B

C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA

I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
```

from looking at dmesg it looks like it was successful here as well... partial dmesg follows....

```
hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

usb 1-1: new full speed USB device using uhci_hcd and address 2

scsi0 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 2

usb-storage: waiting for device to settle before scanning

usb 1-2: new full speed USB device using uhci_hcd and address 3

scsi1 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 3

usb-storage: waiting for device to settle before scanning

  Vendor: General   Model: USB Disk Drive    Rev: 1.00

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sda: 250783 512-byte hdwr sectors (128 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

SCSI device sda: 250783 512-byte hdwr sectors (128 MB)

sda: assuming Write Enabled

sda: assuming drive cache: write through

 /dev/scsi/host0/bus0/target0/lun0: p1

Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0

Attached scsi generic sg0 at scsi0, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete

  Vendor: WDC WD80  Model: 0JB-00CRA1        Rev: 17.0

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sdb: 156301488 512-byte hdwr sectors (80026 MB)

sdb: assuming drive cache: write through

SCSI device sdb: 156301488 512-byte hdwr sectors (80026 MB)

sdb: assuming drive cache: write through

 /dev/scsi/host1/bus0/target0/lun0: p1

Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0

Attached scsi generic sg1 at scsi1, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete

ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 11

ACPI: PCI interrupt 0000:00:05.1[B] -> GSI 11 (level, low) -> IRQ 11

nm256: no ac97 is found!

  force the driver to load by passing in the module parameter

    force_ac97=1

  or try sb16 or cs423x drivers instead.

NeoMagic 256: probe of 0000:00:05.1 failed with error -6

eepro100.c:v1.09j-t 9/29/99 Donald Becker http://www.scyld.com/network/eepro100.html

eepro100.c: $Revision: 1.36 $ 2000/11/17 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others

parport_pc: Ignoring new-style parameters in presence of obsolete ones

parport: PnPBIOS parport detected.

parport0: PC-style at 0x378, irq 7 [PCSPP,TRISTATE]

e100: eth0: e100_watchdog: link up, 100Mbps, full-duplex

hub 1-0:1.0: port 2 disabled by hub (EMI?), re-enabling...

usb 1-2: USB disconnect, address 3

usb 1-2: new full speed USB device using uhci_hcd and address 4

scsi2 : SCSI emulation for USB Mass Storage devices

usb-storage: device found at 4

usb-storage: waiting for device to settle before scanning

  Vendor: WDC WD80  Model: 0JB-00CRA1        Rev: 17.0

  Type:   Direct-Access                      ANSI SCSI revision: 00

SCSI device sdb: 156301488 512-byte hdwr sectors (80026 MB)

sdb: assuming drive cache: write through

SCSI device sdb: 156301488 512-byte hdwr sectors (80026 MB)

sdb: assuming drive cache: write through

 /dev/scsi/host2/bus0/target0/lun0: p1

Attached scsi disk sdb at scsi2, channel 0, id 0, lun 0

Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 0,  type 0

usb-storage: device scan complete

```

 usb kernel config follows..... 

```
#

# USB devices

#

# CONFIG_SND_USB_AUDIO is not set

# CONFIG_SND_USB_USX2Y is not set

#

# Open Sound System

#

# CONFIG_SOUND_PRIME is not set

#

# USB support

#

CONFIG_USB=m

# CONFIG_USB_DEBUG is not set

#

# Miscellaneous USB options

#

CONFIG_USB_DEVICEFS=y

# CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

#

# USB Host Controller Drivers

#

CONFIG_USB_EHCI_HCD=m

# CONFIG_USB_EHCI_SPLIT_ISO is not set # CONFIG_USB_EHCI_ROOT_HUB_TT is not set

CONFIG_USB_OHCI_HCD=m

CONFIG_USB_UHCI_HCD=m

# CONFIG_USB_SL811_HCD is not set

#

# USB Device Class drivers

#

# CONFIG_USB_AUDIO is not set # CONFIG_USB_BLUETOOTH_TTY is not set # CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set

CONFIG_USB_PRINTER=m

#

# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information

#

CONFIG_USB_STORAGE=m

# CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_RW_DETECT is not set # CONFIG_USB_STORAGE_DATAFAB is not set

# CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set

# CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set

# CONFIG_USB_STORAGE_JUMPSHOT is not set

#

# USB Input Devices

#

CONFIG_USB_HID=m

CONFIG_USB_HIDINPUT=y

# CONFIG_HID_FF is not set

CONFIG_USB_HIDDEV=y

#

# USB HID Boot Protocol drivers

#

# CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set

# CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set

# CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set

#

# USB Imaging devices

#

# CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # CONFIG_USB_HPUSBSCSI is not set

#

# USB Multimedia devices

#

# CONFIG_USB_DABUSB is not set

#

# Video4Linux support is needed for USB Multimedia device support

#

#

# USB Network Adapters

#

# CONFIG_USB_CATC is not set # CONFIG_USB_KAWETH is not set # CONFIG_USB_PEGASUS is not set # CONFIG_USB_RTL8150 is not set

# CONFIG_USB_USBNET is not set

#

# USB port drivers

#

# CONFIG_USB_USS720 is not set

#

# USB Serial Converter support

#

# CONFIG_USB_SERIAL is not set

#

# USB Miscellaneous drivers

#

# CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_TIGL is not set # CONFIG_USB_AUERSWALD is not set

# CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set

# CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set

# CONFIG_USB_TEST is not set

#

# USB ATM/DSL drivers

#

#

# USB Gadget Support

#

# CONFIG_USB_GADGET is not set

```

----------

## yaneurabeya

You might have to create your own boottime service based on the fstab script combined with an invocation of coldboot and just remove the coldboot service from default/boot after root has been mounted. In theory it might work, but hopefully /var isn't needed for your coldboot hybrid script to run.

What exactly are you trying to accomplish though by doing this?

----------

## decrease789

.... well... I am trying to mount this drive on var because.... 

1) I don't have enough space on my server to spare for backups (using rsync) with my laptop

2) I want all the my webspace from /var/www on a large drive

3) I want all my emails from /var/qmail/Maildir (or wherever) on a large drive

4) I don't really want to partition the usb drive (which is 80 GB)

5) I want to mount my usb sd card reader/writer as swap... but at the mount that won't mount with fstab.

I don't understand why a usb device will not mount with fstab.... i have done this before a long time ago.

I have mirrored the drive to be exactly the same as /var at the moment.... but still it will not mount  :Sad: 

----------

## yaneurabeya

I know this might seem like more of a pain in the neck, but it's more doable for you...

Just create entires in your /etc/fstab file to reference your /var/www directory and your /var/qmail/Maildir dirs and then just add your swap correctly like you normally would. Just be sure to add coldboot before your swap if you can (dunno if this is possible  :Shocked: )...

----------

## decrease789

 *Quote:*   

> /etc/fstab file to reference your /var/www directory and your /var/qmail/Maildir

 

not sure what you mean! do you mean i should partition the drive? Do i have to do that? Is it possible to use symbolic links instead? I am sure you do not need coldboot before fstab for it to work. There has to be something I am missing.... somewhere........ I wonder what it is.....

----------

## yaneurabeya

Here's what I meant using the format in /etc/fstab...

```
/dev/sdb1                       /var/www             reiserfs            defaults,auto 0 0

/dev/sdb2                       /var/qmail/Maildir  reiserfs            defaults,auto 0 0

```

That is if you can partition your USB flash card thingie XD.

----------

## decrease789

yeah thats what i thought....

i just had a thought... i think it isn't mounting it because i have compiled it into the kernel as a module... which means it hasn't loaded until after fstab as run

----------

## yaneurabeya

Even then dev node won't be made yet I think, but it's worth a shot  :Wink: . Try compiling it in statically as opposed to a module  :Smile: .

----------

## decrease789

 *Quote:*   

> Missing device node files at boot
> 
> If you can't boot successfully because you get an error about /dev/null not found, or because the initial console is missing, the problem is that you lack some device files that must be available before /dev is mounted and handled by udev. This is common on Gentoo machines installed from old media.
> 
> If you run sys-apps/baselayout-1.8.12 or later, this problem is alleviated since the boot process should still manage to complete. However, to get rid of those annoying warnings, you should create the missing device nodes as described below.
> ...

 

what about this? in the gentoo udev guide? is this related.... i ll get compiling that kernel

----------

## yaneurabeya

Actually what you have listed above is what I was thinking of doing in the first place maybe...

----------

## jamapii

Maybe you can write a boot script that just mounts the devices you want after coldboot. Let's call it "provide_var". This would have the line "need coldboot" in depend(). Now all boot scripts that need /var need a line "need provide_var" in their depend().

However, this creates a minor maintenance burden when you do the etc-update...

----------

## yaneurabeya

 *jamapii wrote:*   

> However, this creates a minor maintenance burden when you do the etc-update...

 

Use dispatch-conf. Much better.

```
emerge gentoolkit
```

----------

## decrease789

yipee!!!!! 

it works.... all i had to do was compile usb-storage in as a module and i can boot it as /var .... i have deleted my old /var and it works fine..... thanks for all your help

----------

