Ubuntu :: Mount Drive In Bash Script?

Apr 3, 2011

I've written a script which does various rsync commands to a Linux server where I backup all my files.My Ubuntu (Lucid) PC has 3 internal drives in it, the Ubuntu partations are all on one disk, then I have 2 further disks both have a single NTFS partition (leftover from my Windows days).When I want to mount one of the NTFS drives I just hit the drive name in Nautilus, handily they are both listed in 'Places'nted in:/media/FDrive/media/DDriveBack to my rsync script - it rsyncs files from both /media/FDrive and /media/DDrive. So at the moment I make sure both disks are mounted before running my rsync script, if they're not I just mount them by clicking on them in Nautilus before running the script.But now I want to run my rsync script using a cron job. So I've written a test in the script to check if they are mounted, like this:

Code:
cat /etc/mtab | grep /media/DDrive > /dev/null
RetVal=$?

[code]....

View 6 Replies


ADVERTISEMENT

Ubuntu Servers :: Mount A USB Drive In Rc.local With /sbin/mount And UUID Instead Of Fstab?

Feb 6, 2010

I run a headless Ubuntu 8.04 server, which acts as a web, email and file server. I am sticking with 8.04 as it is a LTS release and will upgrade to the next LTS when it is released.

I have two external USB drives, that I need to mount at boot. I have been using /etc/fstab up until now, with the following entries:

Code:

However, as I gather from doing searches is quite common, occasionally I get an error during boot (causing the system to drop to a recovery shell) because the USB drives take time to wake up and the system hasn't found them by the time it reads /etc/fstab.

From doing searches, it seems there is nothing you can do to fstab to fix this, so you need to mount them using an rc.local script instead, using:

Code:

The problem is, as I have two USB drives, their /dev/sdxx location changes between boots. I thus want to use UUID codes as I do in fstab, however I haven't found anything about this.

Does anyone know how I can use the mount command and UUID to mount a drive in rc.local and what options I have to use the mount the drive with the same options that I am using in my fstab entry? Obvisouly, I can't refer back to fstab using the mount command, because then I will still get the boot error issue if they are listed in fstab. And there is no space internally for the USB drives as there is already two internal drives.

View 3 Replies View Related

Ubuntu :: Unable To Mount Internal Drive - Error: Mount Exited With Exit Code 1: Helper Failed

Aug 5, 2010

I have 2 internal drives. One is for the OS and one is for the Data. I tried to get the Data drive to mount automatically at login using some crap I found on a linux blog. Safe to say it didn't work and now I can't mount it with the OS on the OS Drive.

It mounts from a live CD and all the data is perfectly safe. When I try to mount the drive I get this error message: "Error mounting: mount exited with exit code 1: helper failed with: mount: only root can mount /dev/sdb1 on /media/data" What have I done wrong and how can I make it mount again? Preferably this time at login.

View 2 Replies View Related

Ubuntu Networking :: Samba And External Drive - Unable To Mount Location - Failed To Mount Windows Share - Dialog Box

May 25, 2010

I have been trying to share folders from my main PC which is running Ubuntu 10.04. I have been able to figure out Samba enough to get my a couple of folders shared, but I have been unable to share any folders which are on my external harddrive. After entering the path in my smb.conf file they appear on the network but I am unable to navigate to them. When trying to navigate to them through the network folder on the pc they are actually connected to I get an "Unable to mount location: Failed to mount windows share" dialog box. On the windows pc I am trying to share with I get, "Windows cannot acces \Josh-Desktop
ame of folder"

My smb.conf file looks like this:

That folders I cannot access are Music and Videos.

View 9 Replies View Related

General :: Mount External USB Drive In Debian To A Mount Point Based On The Volume Name

May 5, 2011

How do I configure my Debian installation to mount external USB drives to mount points based on the volume names of the drives? For instance, if I have a thumb drive with the volume name of "SWORDFISH," how do I have Linux mount it at /media/SWORDFISH? I'm aware that this can be setup in FSTAB, but that requires that I know the UUID of the device beforehand and that I take the time to set each external device up in FSTAB first. That does nothing for me when I have a thumb drive that has never been plugged into my computer before.

This seems to be setup by default in Ubuntu/Kubuntu, but is not working for me with a fresh installation of Debian Squeeze and KDE4. I've spent the past 2 hours Googling for a solution and have turned up nothing. UPDATE: My results are inconsistent. Sometimes Debian mounts devices to mount points based on the volume names, and other times it gives them generic mount points (e.g. /media/usb1).

View 2 Replies View Related

Software :: Unable To Mount Windows Drive - Mount Error 92 = Protocol Not Available

Oct 4, 2010

Not able to mount windows drive & foder, in linux. i have got following error.

mount error 92 = Protocol not available

View 10 Replies View Related

Server :: Auto Mount USB Drive To Specified Mount Point After Reboot

Jul 19, 2010

I have servers installed with RHEL 4 2.6.9-89.0.9 ELsmp. I tried using uuid and label in /etc/fstab to automount usb drives to mountpoints that I specify after reboot. Unfortunately, it just does not work in all my RHEL4 servers. After every reboot, /etc/fstab will be automatically modified and all configurations related to my USB drives will be changed. Irregardless of whether i use UUID or LABEL in my /etc/fstab.However, it works on RHEL5. But, upgrading is not an option in my environment. I have been googling around looking for alternatives but everything seems to point back to using UUID or LABEL in /etc/fstab. Anyone has tried something that works? Please help me, thank you.

View 7 Replies View Related

Fedora X86/64bit :: USB Flash Drive Mount - Un-mount ?

Sep 17, 2010

Its annoying to unmount my flash drive twice.. its not a major problem actually but its kinda annoying , its whenever i plug-in my flash drive.. everything works well except when i need to un-mount it.. I usually unmount it twice using right-click of the mouse, then it mounts itself back, so i have to unmount it again.. Is there any way to control this? How do i setup the auto-mount option for USB flash drives?

View 1 Replies View Related

Ubuntu Networking :: Get Network Drive To Mount As A Local Drive?

Aug 2, 2010

I was trying to figure out how to get my network drive to mount as a local drive on my computer. This was back on 9.10. Since I've upgraded to 10.04, my boot process halts and tells me (paraphrasing) /shared is not ready to mount. To continue, pres S to skip or M to manually mount the drive.

Well, I have it mounting now through GVFS and I don't need this in my startup anymore. Frankly, it's just annoying that it won't boot into Ubuntu right away. So, what's the startup file I need to edit to remove the attempt to mount the network drive?

View 1 Replies View Related

Ubuntu :: Add More Space - C Drive Is Mounted And The E Drive Will Not Mount

Jan 19, 2011

I have just installed Xubuntu and suprisingly it did not ask me to create a partition within its installer like Ubuntu does. So now, I am left with 150mb of free space. I want to expand that amount. The problem is, I do not know where it has been installed on. I have a C and an E drive. Currently, the C drive is mounted and the E drive will not mount even if i press the mount button. Does anyone have a solution?

View 8 Replies View Related

General :: Dvd Rom Drive Won't Mount Under FC14 After Installing From Dvdrom Drive?

Jun 12, 2011

no entries exist in the /dev folder for hdc,cdrom,dvd, or any other drive or drive type than hda. The only other similar device is sg0 which doesn't work either. I have tried every variation of mount I can find with every available drive and drive type and nothing works, but this is the drive I installed FC14 with, and it installed perfectly (except for forgetting where it came from!!)Do I have to install a module or recompile the kernel just to get linux to recognize the drive it came from?

View 5 Replies View Related

Ubuntu :: Can't Load A Drive / Volume - "Unable To Mount Location Error Mounting: Mount: /dev/sda1: Can't Read Superblock"

Dec 25, 2010

I have a problem in my ubuntu 10.01 that it can't load a drive/volume in ubuntu. When I tried, it said: "Unable to mount location Error mounting: mount: /dev/sda1: can't read superblock". And when I boot my pc with 'Windows', it said : "UNMOUNTABLE_BOOT_VOLUME" under a blue screen. What can I do to solve this problem?

View 9 Replies View Related

Ubuntu :: Bash Script That Uses Sshfs To Remotely Mount A SSH Directory?

Apr 23, 2010

I have a bash script that uses sshfs to remotely mount an SSH directory.

Where should i place this script so it mounts with route privileges?

One consideration is i use VPN so the directory needs to be mounted after openvpn is started.

View 3 Replies View Related

Ubuntu :: Bash-completion + Mount = Failure To Complete Directories?

May 27, 2011

I've spent some time searching for answers to this and I haven't found much at all.Please feel free to post pointers to other threads that discuss this particular problem, if you find any.The problem is that in bash I want to mount an iso file to inspect the contents with the command:Code:sudo mount myCD.iso CDMount -o loopThe command works fine, but pressing tab to complete either the iso filename or the CDMount directory does not work. The completion suggestions I get are existing mountpoints which The completion suggestions should include the files and directories in the current directory. This worked with Ubuntu 10.04 and not with 11.04.

View 1 Replies View Related

OpenSUSE :: Mount Encrypted Partition With Bash Script?

Oct 14, 2010

I currently have a simple bash script set up via cron to backup my data (rsync) to an internal hard drive at regular intervals. I leave this "backup" hard drive unmounted, and it is mounted and unmounted as needed with the bash script. If I were to encrypt this "backup" drive (via Luks, or some other means), is there a way to get my backup script to work without me having to be there to enter a password?

View 4 Replies View Related

Ubuntu Security :: Truecrypt - Remote Mount Volume - Or Send Bash Script Remotely?

Apr 1, 2011

I have an Ubuntu 10.04 machine at home and apache setup on it (files are located in a Truecrypt volume). The reason for the web server being that I wanted to access my files wherever I'm at (i.e. hotel, work, hotspots, etc...). So far, it's worked out great for me seeing as a I can http download my files (or stream media files). However, I am often on a public hotspot and I know it's a matter of time before someone finds the webserver on my computer. I have the machine firewalled and password protected (via .htaccess), but either way I don't want people looking in on my computer.

The problem: I have used Truecrypt for a long time and completely trust using the program to encrypt/unencrypt a volume container to store my files. Usually, I would remote desktop into my computer and mount/unmount the volume when I needed it. However, after time it get's really annoying to do this. So I eventually figured out how to setup a bash script to automatically do this for me (which I put on the usb part of my phone). What I wanted to do was to be able send the bash script to my Ubuntu machine (via ftp from my phone) and have Ubuntu automatically run the script. Is this possible? What programs do I need on Ubuntu?

I was thinking about using something like cron, but that is for scheduled times. I don't really have a set time in which I need my files, it's pretty sporadic depending on how much I travel. Thus the need for being able to remotely mount the volume when I need it.

Summary: I need a way for Ubuntu to read a folder every minute or so to check for bash scripts to run. I want to be able to send the bash script via ftp from my phone, have Ubuntu run the script, then delete itself (so as to not store the password). I already know the script in which to mount the Truecrypt volume and how to send the file via ftp from my phone. It's really a matter of what program to use in Ubuntu to find and run the script.

View 8 Replies View Related

CentOS 5 Hardware :: NTSF Mount - Bash: /dev/sda1: Permission Denied

Nov 5, 2009

I have tried to mount Sda on my laptop HP dv6 and I have got this problem [root@cpe-74-71-125-175 ~]# /dev/sda1 /mymount/win ntfs-3g rw,umask=0000,defaults 0 0 bash: /dev/sda1: Permission denied

View 3 Replies View Related

Ubuntu :: Bash Copying Files From One Drive To Another?

Nov 15, 2010

I've got two external hard drives, a 2TB and a 320GB. I've recently come from Windows 7. On Windows 7 I wrote a batch file which checked whether both hard drives existed and then copied a couple of folders from the 2TB to the 320GB without overwriting. I've been trying to work out how to do the same under Linux without much luck. I've tried rsync but it looks like it overwrites. Does rsync overwrite?

If it helps, the batch file I wrote in Windows

if exist D:320GBDrive (if exist H:2TBDrive (xcopy H:2TBDrive* D:320GBDrive /I/E /-Y < C:decline_copy.txt))

Which basically checks for drive D:, checks for drive H: and then copies the contents of the folder on drive H to drive D and says no every time it asks to overwrite.

View 2 Replies View Related

Ubuntu :: Cannot Mount Drive ?

Mar 22, 2010

I've been trying to mount a USB drive, this is what I've done so far

sudo fdisk -l

Code:

Code:

Tried to mount again, same problem.

Tried mounting to mount point:

Code:

I'm not sure what else to try. My other USB drives don't have this problem, in fact, this one has worked fine so far.

I have about 2gb of photos stored on it, so I can't wipe it.

View 9 Replies View Related

Ubuntu :: Can't Mount GPT Drive?

Jun 12, 2010

I'm using Hyper-V and using physical disk pass-through to pass a physical disk to Ubuntu but I'm having problems. Here's my fdisk -l output:

Code:
Disk /dev/sdb: 2199.0 GB, 2199023255552 bytes
256 heads, 63 sectors/track, 266305 cylinders
Units = cylinders of 16128 * 512 = 8257536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

[Code]...

View 2 Replies View Related

Ubuntu :: Can't Mount D Drive?

Jun 16, 2010

I just reinstalled Ubuntu 10.04 because of problems with windows. I can see both my drives with gparted, but I cannot mount the d drive, I put the Ubuntu install next to windows on the c drive but last time I installed 10.04 I could see my d drive, that is where all my music and .avi files are located. I get an error when trying to mount this drive:

[Code]...

Just found out that after the 10.04 install, my d drive was wiped out, any way of getting those files back? I haven't formatted yet with windows. Windows needs to format it and Ubuntu can't mount it, it is nowhere land.

View 3 Replies View Related

Ubuntu :: Mount Second Drive ?

Feb 8, 2011

"Old" disk was the primary - and only - drive. 500 GB.

I have to move that drive to a new machine off-site, so I'd like to get the 10 or so GB of data from it and put the data on a "new" drive - 80 GB, with an existing maverick installation.

I tried to use Acronis to create an image. That way, the new drive would be a clone of the old drive, other than being much smaller. Acronis wouldn't allow it because of the size difference.

When booting to the "new" sda everything works ... except that maverick "sees" sdb, but won't let me access the data partition sdb2.disk utility "sees" sdb and describes it as having boot partition sdb1, and the other 499 GB , sdb2 (and sdb5) nautilus and dolphin both "see" sda and can access all of the data (such as it is, given that it's a new installation) nautilus and dolphin both "see" sdb, but only access the 255 MB boot partition sdb1 I tried doing a clean install on the "new" drive. In that install I left the old drive in place as a second drive - hoping that the installation would recognize it as a second drive and mount it properly.

However:
1) it didn't do anything with the old drive and

2) the results are the same - no access to the data partition on the "old" drive.

I think the problem is that I need to mount sdb2, but I can't figure out how. Here is the information from fdisk:

Do I enter information in fstab to enable mounting? If so, which information do I use?

Or is there another way to access the 10 GB of data on sdb and get it on to sda?

By the way, in the course of messing with this, I managed to make the "old" drive unbootable, so I can't just reverse the drives' roles. The "old" drive has the boot partition marked as bootable, and I switch drive jumpers (and cable setup)

View 8 Replies View Related

CentOS 5 :: Executing Bash On External Drive

Jun 7, 2010

I have a CentOS system totally devoted to a 500GB disk. I have an additional disk mounted via an external device that will not execute scripts that are located on that device.

Current hardware configuration:
Quote:
t [root@localhost ~]# fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 60801 488279610 8e Linux LVM

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 42261 339457466+ 83 Linux
/dev/sdd2 42261 60801 148925985+ 5 Extended
/dev/sdd5 59372 60801 11486443+ 82 Linux swap / Solaris
/dev/sdd6 42261 58671 131814400 83 Linux
/dev/sdd7 58671 59371 5623808 82 Linux swap / Solaris

Partition table entries are not in disk order
[root@localhost ~]# uname -a
Linux localhost 2.6.18-194.3.1.el5 #1 SMP Thu May 13 13:08:30 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#

View 17 Replies View Related

Ubuntu :: Can't Mount External Drive

Apr 6, 2010

Error mounting: mount exited with exit code 32: mount: wrong fs type, bad option, bad superblock on /dev/sdb1,

missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

I get this when I try to mount this drive. I was working just fine and then when I tried to mount again to pull some data off It gave me an error. It is an internal hard sata hard drive hook up via usb with a usb to sata converter. Is there some kind of disk check i can do to find errors. There is data on there I would like to keep

View 1 Replies View Related

Ubuntu :: Mount Drive Via Ssh At Boot?

Jun 6, 2010

I want to automatically mount an SSH server on boot. I am able to do this manually by running this script after I reboot

Code:
#!/bin/bash
clear
sshfs -o idmap=user user@server:/ /home/fro1269/sshmount
I have put the script in /etc/networking/if-up.d/

but it does not mount after the network is connected. This is on a laptop that connects via wifi. So my network connection does not start until a few seconds after the desktop loads. I am running 10.04.

View 3 Replies View Related

Ubuntu :: How To Mount External Drive?

Jun 15, 2010

How to mount external drive in Lubuntu?

View 3 Replies View Related

Ubuntu :: Mount A Drive In 2 Folders ?

Aug 8, 2010

I mounted a hard drive and its working ok. But I want to expand on it. I'd like to make it accessible via another folder, like make it look like /home/cackles/added as well as simply just /added. Is it just like when you mount the drive and add the line to fstab?

View 2 Replies View Related

Ubuntu :: 10.04 - Unable To Mount 1TB Drive

Aug 22, 2010

Ubuntu 10.04 - it lives on 1TB drive. Then I have another 1TB drive that has 2 partitions. One of the partitions has XP and other is empty awaiting a WIN7 install. Then I also have a 2TB back up drive. All said - on the odd boot I'm unable to mount the other drives.

View 3 Replies View Related

Ubuntu :: Can't Mount 2nd Hard Drive?

Aug 24, 2010

I have got 2 hard drives running one one of my computers which i am running as an server. I was using Ubnntu Server which is good but i have decided to change the way that i am going to use the server and have installed Xubuntu over ubuntu server. However in the installation the hard drives shwn when it asked where i would like to install the operateing system. It installed sucessfully and is working but it cant mount my other hard drive which has all of my data on it.

I had tried mounting it throught the command prompt and had no success. After which i have checked if the the toher hard drive is being reconised by Xubuntu and it is as sdb1 but i caqnt mount it and get to my data. I hoped that i can try and put in my ubuntu live cd and see if it can pick the seoncd hard drive up and mount it which it has not been able to.

I have 2 20 gigabyte hard drives atm the moment and i am not adding the others until i can get to all my stuff again form the other hdd.

View 9 Replies View Related

Ubuntu :: Usb Drive Doesn't Mount?

Sep 6, 2010

My friend gave me a usb drive which doesn't mount. When I plugged it in, I got this on dmesg:

[Code]....

The usb drive is supposed to be on /dev/sdb, however when I try to read /dev/sdb with head, I get: head: cannot open `/dev/sdb' for reading: No medium found I cannot get it to work with fdisk, gparted, mount, and all I can get is No medium found. I am ready to call this drive dead.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved