LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mount drives on start up (https://www.linuxquestions.org/questions/linux-newbie-8/mount-drives-on-start-up-507627/)

giokat 12-05-2006 09:42 AM

mount drives on start up
 
i m glad i find this forum, i m total new to linux and i have a problem,
i have a server (debian installed) and it have some hard disks all mirrored in dev/sda1 /test/test1
(i dont use raid)
i have added the disks to test1 dir with this ssh commant :
mount -t xfs /dev/sda1 /test/test1
the problem is that when i m restarting the server its not possible to see the disks and i have to run the commant once more.
how is possible to run this commant on the server start up?
can anyone help with this?
thanks in advance

Wells 12-05-2006 10:13 AM

You need to edit /etc/fstab. Reading the man page on fstab would also be a good idea.

Broder 12-05-2006 10:51 AM

As root, edit the /etc/fstab file. The line that corresponds to your drive will have a 'noauto' entry. Set this to 'auto' and it will mount upon start up.

kcirick 12-05-2006 11:21 AM

An example may help. Here's what I have for my /etc/fstab:

Code:

/dev/hda5        swap            swap        defaults        0  0
/dev/hda6        /                ext3        defaults        1  1
/dev/hda1        /fatc            vfat        defaults        1  0
/dev/cdrom      /mnt/cdrom      auto        noauto,user,ro  0  0
/dev/sda1        /mnt/floppy      auto        noauto,user      0  0
/dev/sdb1        /mnt/stick          auto              noauto,user      0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0

I have none of the external drives set to mount on startup (See /dev/cdrom/, /dev/sda1 and /dev/sdb1 is set to "noauto" on the 4th column). Setting these to "auto" will mount these drives on startup.

Not to confuse with the "auto" on the 3rd column though... "auto" on the 3rd column means "detect the filesystem automatically"

giokat 12-05-2006 01:38 PM

> my /fstab lines looks like this now:


Quote:

> /dev/sdb3 / ext3 defaults,errors=remount-ro 0 1
> /dev/sdb1 /boot ext2 defaults 0 2
> /dev/sdb2 none swap sw 0 0
> /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
> /dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
> /dev/sda1 /raid ext3 defaults 0 0

> /dev/sda1 /test/test1 xfs defaults 0 0

i have added the line:
Quote:

> /dev/sda1 /test/test1 xfs defaults 0 0

but i think that i have to move this 1:
Quote:

> /dev/sda1 /raid ext3 defaults 0 0
shall i do it?

Vitalie Ciubotaru 12-05-2006 01:53 PM

1. What filesystem does your SCSI drive [/dev/sda1] use? It can't be "ext3" and "xfs" in the same time. This means one of the line just won't work. Issuing "fdisk /dev/sda" and pressing "p" will make it clear which filesystem is correct [press "q" to quit the fdisk].
2. Where do you want your SCSI drive to be mounted? If /test/test1 is OK for you and you don't need to have it available from /raid, you can just comment the "/dev/sda1 /raid ext3 defaults 0 0" line out.
Hope it helps

Vitalie CIUBOTARU

giokat 12-05-2006 02:07 PM

here is what i have

Quote:

Disk /dev/sda: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 267350 2147483647+ ee EFI GPT
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 1) logical=(0, 0, 2)
Partition 1 has different physical/logical endings:
phys=(1023, 254, 63) logical=(267349, 89, 4)


All times are GMT -5. The time now is 11:45 PM.