Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-26-2008, 03:25 PM
|
#1
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Rep:
|
Can't rsync to USB drive
Frustrated and embarrassed, I can't seem to get this command to work. I know I have permissions right. It must be that I'm not typing something right.
sudo rsync -avz --delete /source/directory /destination/directory
where: /home/rich is source, but I'm not clear what the destination is.
I have tried these:
/media/my_external/Backup
/dev/sdb1/my_external/Backup
/my_external/Backup
"my_external" is the label I assigned the USB drive. I created a folder on that drive named Backup.
Any ideas what I'm doing wrong.
|
|
|
|
07-26-2008, 03:44 PM
|
#2
|
|
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684
Rep:
|
/media/my_external/Backup should be the right one if it is mounted to /media
What filesystem is on that drive? (I ask because probably all of them come formated as "vfat" - which will not work)
If it is a linux filesystem: how is it mounted?
What was the error?
|
|
|
|
07-26-2008, 03:45 PM
|
#3
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,827
|
well you need to mount the drive somewhere before you can use it with rsync. so forget about rsync for now and just check where it's mounted with the mount command itself.
|
|
|
|
07-26-2008, 05:37 PM
|
#4
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
I formatted it to ext3.
I'm lost about mounting it. Don't understand at all. I plug in the USB cable, the icon is on the desktop. I can drag and drop or copy paste files. But not rsync. How do I mount it, and where? Confused.
Results of mount:
rich@rich-laptop:~$ mount my_external
[mntent]: warning: no final newline at the end of /etc/fstab
mount: can't find /home/rich/my_external in /etc/fstab or /etc/mtab
|
|
|
|
07-26-2008, 05:52 PM
|
#5
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
OK. It seems to be mounted. Here's the result of mount. I see it in the last line.
rich@rich-laptop:~$ mount
/dev/sda1 on / type ext3 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
procbususb on /proc/bus/usb type usbfs (rw)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.20-17-generic/volatile type tmpfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/scd0 on /media/cdrom0 type iso9660 (ro,noexec,nosuid,nodev,user=rich)
/dev/sdb1 on /media/my_external_ type ext3 (rw,nosuid,nodev)
rich@rich-laptop:~$
|
|
|
|
07-26-2008, 06:00 PM
|
#6
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
rich@rich-laptop:~$ sudo rsync -avz --delete /home/rich/Test.odt /media/my_external
Password:
building file list ... done
Test.odt
sent 23990 bytes received 42 bytes 48064.00 bytes/sec
total size is 25412 speedup is 1.06
rich@rich-laptop:~$
Does this look like it wrote the file on the USB? It is NOT on the USB. Hmmmm. It surely must be something simple I'm doing wrong, but ???
|
|
|
|
07-27-2008, 01:25 AM
|
#7
|
|
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684
Rep:
|
The mount options seem to be the problem. It is mounted automatically for you with options: "nosuid" and "nodev"
"nosuid" likely beeing the problem.
Mount it "by hand".
Code:
# first unmount it from /media
sudo umount /media/my_external_
# then make the mountpoint
sudo mkdir /mnt/my_mountpoint
# mount it
sudo mount /dev/sdb1 /mnt/my_mountpoint/
# and then try:
sudo rsync -avz --delete /home/rich/Test.odt /mnt/my_mountpoint/
Be sure what you write: you wrote:
my_external_
but also
my_external
obviously only one is correct
|
|
|
|
07-27-2008, 01:57 AM
|
#8
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,827
|
well you mount output clearly states "/media/my_external_" not "/media/my_external"
|
|
|
|
07-27-2008, 01:10 PM
|
#9
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
I made several mistakes. One is that I did a right-click > Create Folder within the USB drive browser window. And I did some copy-paste and drag-drop to the USB. Then messing around more, I seem to have mounted it twice, which caused the duplicate folders:
my_external
my_external_
Looks like I need to add everything to the USB via tar, rsync, or such - to maintain permissions, etc. NO copy-paste, and NO right-click > Create Folder from the USB browser window.
I used nautilus to delete everything. Then WAS able to write files on the drive with tar, and also with rsync.
But deleting everything like that also removed the lost+found folder. So, I did a fresh reformat to ext3 for a clean start.
I'd like to do more testing, by adding archives, folders, files to the USB drive, can I "correctly" delete them by right-click > Move to Trash from within the USB drive browser window? Or do I need to use tar or rsync to remove them?
Thank you for helping!
|
|
|
|
07-27-2008, 02:32 PM
|
#10
|
|
Senior Member
Registered: May 2004
Location: Leipzig/Germany
Distribution: Arch
Posts: 1,684
Rep:
|
If you just wanted to copy something to the drive - drag&drop would be a good way.
To use rsync you need the permissions to be different than they are when it is automatically mounted (when you plug it in).
The lost+found folder is not important at all - it will be recreated everytime you fsck (check) the drive.
to remove:
Nautilus preferences --> behaviour --> trash: provide a delete command circumventing the trash
I think it will just alert you that it cannot move to trash and offer deleting instead.
|
|
|
|
07-27-2008, 03:32 PM
|
#11
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
Thank you!
|
|
|
|
08-11-2008, 04:22 PM
|
#12
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
I need help again !! My machine crashed this morning (another topic for later) and I need to restore things.
On the USB drive, in a folder named 07_31_2008 I placed the following:
rich (home dir)
etc
var
usr
I need to get those on to my laptop hard drive. I have tried different combinations of the rsync command to copy from the USB to sda1, but none of them work. I don't know how to issue the rsync command to restore those files back to my laptop FROM the USB drive.
Can you help me?
Thank you.
|
|
|
|
08-11-2008, 07:03 PM
|
#13
|
|
Member
Registered: Oct 2007
Location: U.S.
Distribution: Ubuntu Lucid Lynx 10.04
Posts: 162
Original Poster
Rep:
|
Dang. The "options" in the rsync command are NOT OPTIONAL.
You MUST include at least on OPTION.
This continues to trick my pea brain. Arrgghhh!!!!
Got it fixed. Back to work.
Rich
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 08:02 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|