Hi,
I have a hotswap sata drive that I use for backups on a PC running Ubuntu 12.04LTS. When I insert the drive it shows correctly on the desktop and I can double click the icon to show the contents of the device.
I want to write a script to copy certain files from the pc onto the removable drive, but I am having trouble mounting the hotswap drive as I never know what device id it will have allocated.
When I first insert the drive it allocates it as /dev/sdf1, but if I remove the drive and re-insert it, it allocates it as /dev/sdg1. How do I write the mount command (or copy command?) so I can find the drive id?
This is what I have:
sudo mount /dev/sdf1 /media/128GB_SSDcp /home/dfsql01/dumps/*.sql /media/128GB_SSD/SQL_Backups
`sudo umount /dev/sdf1

Many thanks,
Toomutch

Give the file system on the drive a label. You can then find it with the e2label command.

Thanks for the idea rubberman. The drive is currently formatted NTFS as it also has to be accessed from a Windoze PC.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.