LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   script on USB key ubuntu (http://www.linuxquestions.org/questions/linux-newbie-8/script-on-usb-key-ubuntu-898624/)

SIcan 08-21-2011 10:09 AM

script on USB key ubuntu
 
I try to run a sript from the usb key but does not run.
the same script run hard disk.

crts 08-21-2011 10:30 AM

Hi,

check the mount permissions of the USB key. Which filesystem format does it have?

SIcan 08-21-2011 03:45 PM

Tanks crts, here is the mount info: /dev/sdc1 /media/7006-72B1 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0

an other info: the same key with the same script run on an other PC!
???

crts 08-21-2011 05:10 PM

Quote:

Originally Posted by SIcan (Post 4449544)
rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro 0 0

From the man-page for mount:
Code:

showexec
              If  set, the execute permission bits of the file will be allowed
              only if the extension part of the name is .EXE, .COM,  or  .BAT.
              Not set by default.

Have you tried renaming the script to have a suffix as mentioned above? You might also try to mount it with the 'exec' option. Then renaming the files might not be necessary. Not sure about that since I usually do not run Unix scripts from a windows partition. Try as root
Code:

mount -o remount,rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdXX
where /dev/sdXX is your USB key.

SIcan 08-21-2011 06:30 PM

Hi crts,

when i try your command i get the folowing error:

root@al-N68S3:/home/al# mount -o remount,rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=is o8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdc1
mount: can not find /dev/sdc1 in /etc/fstab or /etc/mtab

thanks

crts 08-21-2011 07:09 PM

Quote:

Originally Posted by SIcan (Post 4449628)
Hi crts,

when i try your command i get the folowing error:

root@al-N68S3:/home/al# mount -o remount,rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=is o8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdc1
mount: can not find /dev/sdc1 in /etc/fstab or /etc/mtab

thanks

Try omitting the remount option and supplying a mountpoint:
Code:

mount -o rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdc1 /path/to/mountpoint
The above command assumes that the USB key is not mounted.

SIcan 08-21-2011 08:01 PM

Thank you crts,


root@al-N68S3:/home/al# mount -o rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdc1 /USBDISK
mount: le point de montage /USBDISK n'existe pas
root@al-N68S3:/home/al# mount -o rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdc1 /media/USBDISK
mount: le point de montage /media/USBDISK n'existe pas
root@al-N68S3:/home/al# mount -o rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=cp437,iocharset=iso8859-1,shortname=mixed,exec,utf8,flush,errors=remount-ro /dev/sdc1 /media
mount: périphérique spécial /dev/sdc1 n'existe pas


I have tried the syntaxes above , but i still get erros.

so i have formated the usb key with ext4 in stead of fat and the script run now

i will reformat it back to FAT and see what`s happen

thank you vey much crts

crts 08-24-2011 07:00 PM

Quote:

Originally Posted by SIcan (Post 4449659)
mount: le point de montage /USBDISK n'existe pas
mount: le point de montage /media/USBDISK n'existe pas

Those messages mean that the directories /USBDISK and /media/USBDISK do not exist. You will have to create them first:
Code:

mkdir /media/USBDISK
The following message
Quote:

mount: périphérique spécial /dev/sdc1 n'existe pas
means that your USB key has probably not been identified as /dev/sdc. Issue the following after you plug in your USB:
Code:

dmesg|tail
The output will tell you that a new device has been recognized and which name it was assigned. You will have to use this name to mount your USB key. Sample output:
Code:

# dmesg |tail
[20935.382010] sd 2:0:0:0: [sdb] Write Protect is off
[20935.382014] sd 2:0:0:0: [sdb] Mode Sense: 03 00 00 00
[20935.382016] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[20935.385752] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[20935.385757]  sdb: sdb1
[20935.620217] sd 2:0:0:0: [sdb] Assuming drive cache: write through
[20935.620223] sd 2:0:0:0: [sdb] Attached SCSI removable disk
[20936.446325] kjournald starting.  Commit interval 5 seconds
[20936.452763] EXT3 FS on sdb1, internal journal
[20936.452771] EXT3-fs: mounted filesystem with ordered data mode.

So my USB drive has in this case been recognized as /dev/sdb. It further tells me that there is one partition /dev/sdb1. The latter can be mounted.

SIcan 08-25-2011 09:39 PM

Hi CRTS,

Thank you for your help.
yes i have there was no directory to mount the the usb key

now it works in FAT too

thanks


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