PDA

Bekijk de volledige versie : post-mount problem



NTAdmin
13-07-2005, 17:21
Hi, I have added post-mount to /usr/local/sbin, made it executable + commited everything to flash and done all required things(post boot works in my case).
But when I mount the drive it doesn't get executed. The log says:



Jul 13 20:18:52 kernel: Vendor: Maxtor 6 Model: Y120P0 Rev: YAR4
Jul 13 20:18:52 kernel: Type: Direct-Access ANSI SCSI revision: 02
Jul 13 20:18:52 kernel: Attached scsi disk sdb at scsi1, channel 0, id 0, lun 0
Jul 13 20:18:52 kernel: SCSI device sdb: 240121728 512-byte hdwr sectors (122942 MB)
Jul 13 20:18:52 kernel: p1
Jul 13 20:18:59 kernel: kjournald starting. Commit interval 5 seconds
Jul 13 20:18:59 kernel: EXT3 FS 2.4-0.9.19, 19 August 2002 on sd(8,17), internal journal
Jul 13 20:18:59 kernel: EXT3-fs: recovery complete.
Jul 13 20:18:59 kernel: EXT3-fs: mounted filesystem with ordered data mode.
Jul 13 20:18:59 USB storage: ext3 fs mounted to /tmp/harddisk


here is the content of post mount:

#!/bin/bash
umount /tmp/harddisk
mount /dev/scsi/host1/bus0/target0/lun0/part1 /home/maxtor -t ext3
touch asd.txt
logger post-mount

And it doesn't work. Any Ideas?

Oleg
13-07-2005, 17:28
There is no bash in the box. Also, move this stuff to the post-boot if you need to mount hdd to a particular location.

NTAdmin
13-07-2005, 18:05
But the point is, that the hdd will not be necessarely present at router boot time, this is why I use the post-mount. So you are saying the thing I am trying to do is not possible to do this way?

Oleg
13-07-2005, 18:26
So, check for presence. And do not use /bin/bash.

NTAdmin
13-07-2005, 18:43
ok, I will, but the manual says, that #!/bin/bash is required in every script.

Oleg
13-07-2005, 18:57
ok, I will, but the manual says, that #!/bin/bash is required in every script.
Really, which one?

NTAdmin
13-07-2005, 19:07
At your page:

All scripts should now have
#!/bin/sh
line, otherwise they will not work