Hi,
I'm trying to implement this:
I have:
- A windows 2000 server - A centos 4 server - Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
Thanks, Ugo
I've used simple scripts for similar backup system. I used hotplug facilities and rsync to avoid copying inecesary data. You must see the USB id which lsusb
in /etc/hotplug/usb/ create the folowing two files: usbhd.usermap containing the folowing line: usbbackup 0x0003 0x05e3 0x0702 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 and usbbackup, containing the backup script (remember to give exec permisions to the script):
#!/bin/bash sleep 30 && \ HD=`e2label /dev/sda1` mount /media/$HD rsync -Pavz --delete /path/to/source/ /media/$HD >/var/log/hdbackup.log renice 20 rsync umount /media/$HD tail /var/log//var/log/hdbackup.log | mail -s "Backup log" destination@email.com
The script is simplified, and the usbhd.usermap id's must be the correct for your usb HD's (use lsusb). I think It's a good aproach to you needings. Perhaps you need to adecuate or enhace the backupscript (mounting remote site which samba, better error control, compressing data, etc..)but now you now how to do it.
Hi,
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
Thanks, Ugo
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
David Ferreira wrote:
I've used simple scripts for similar backup system. I used hotplug facilities and rsync to avoid copying inecesary data. You must see the USB id which lsusb
in /etc/hotplug/usb/ create the folowing two files: usbhd.usermap containing the folowing line: usbbackup 0x0003 0x05e3 0x0702 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
I don't need the script, I just need the windows box to be able to write to the external HDD, and that the external HDD can be changed (not when writing, of course) without any manual intervention.
This is the output of lsusb
[root@server]lsusb Unknown line at line 5959 Unknown line at line 5960 Unknown line at line 5961 Unknown line at line 5962 Unknown line at line 5963 Unknown line at line 5964 Unknown line at line 5965 Unknown line at line 5966 Unknown line at line 5967 Unknown line at line 5968 Unknown line at line 5969 Unknown line at line 5970 Bus 004 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 009: ID 04fc:0c25 Sunplus Technology Co., Ltd Bus 001 Device 001: ID 0000:0000
The device is most likely 001/009 (Sunplus).
lsusb -v shows this (stripped output):
Bus 001 Device 009: ID 04fc:0c25 Sunplus Technology Co., Ltd Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x04fc Sunplus Technology Co., Ltd idProduct 0x0c25 bcdDevice 1.03 iManufacturer 2 Sunplus Technology Inc. iProduct 3 USB to Serial-ATA bridge iSerial 1 WDC WD2500 WD-WXE807734118 bNumConfigurations 1
How would I build my usbhd.usermap file?
Regards, Ugo
Hi
If Device 009 is your USB HD, then, your /etc/hotplug/usb/usbhd.usermap sould look like that:
#usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info usbbackup 0x0003 0x04fc 0x0c25 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
Well, now the script. only one question, Do you use backup exec to write on linuxbox fs and then, rsync to the usb hd?, or do you want to backup exec directly backup to the usb hd? If you do a rsync from local linux fs to the USB disk, you can umount the fs in the script when it's finish. If you choose the second option (Backup diretly to the usb hd) you sould find other way to umount the usb drive once you have finished backup (I think the easiest way is a cron job). I think first option is beter, so you can use this pseudo-script in /etc/hotplug/usb/usbhd:
#!bin/bash mount -t auto /dev/sd0 /mnt/backup rsync -Pavz --delete /tmp/backup /mnt/backup umount /mnt/backup
If you prefere second option, you must made accesible /mnt/backup as you prefer to your windows box, quit rsync and umount from script, and create a cron job to umount the usb drive. I think now is enough clear what do you have to do.
Greetings, David
Ugo Bellavance escribió:
David Ferreira wrote:
I've used simple scripts for similar backup system. I used hotplug facilities and rsync to avoid copying inecesary data. You must see the USB id which lsusb
in /etc/hotplug/usb/ create the folowing two files: usbhd.usermap containing the folowing line: usbbackup 0x0003 0x05e3 0x0702 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
I don't need the script, I just need the windows box to be able to write to the external HDD, and that the external HDD can be changed (not when writing, of course) without any manual intervention.
This is the output of lsusb
[root@server]lsusb Unknown line at line 5959 Unknown line at line 5960 Unknown line at line 5961 Unknown line at line 5962 Unknown line at line 5963 Unknown line at line 5964 Unknown line at line 5965 Unknown line at line 5966 Unknown line at line 5967 Unknown line at line 5968 Unknown line at line 5969 Unknown line at line 5970 Bus 004 Device 001: ID 0000:0000 Bus 003 Device 001: ID 0000:0000 Bus 002 Device 001: ID 0000:0000 Bus 001 Device 009: ID 04fc:0c25 Sunplus Technology Co., Ltd Bus 001 Device 001: ID 0000:0000
The device is most likely 001/009 (Sunplus).
lsusb -v shows this (stripped output):
Bus 001 Device 009: ID 04fc:0c25 Sunplus Technology Co., Ltd Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 64 idVendor 0x04fc Sunplus Technology Co., Ltd idProduct 0x0c25 bcdDevice 1.03 iManufacturer 2 Sunplus Technology Inc. iProduct 3 USB to Serial-ATA bridge iSerial 1 WDC WD2500 WD-WXE807734118 bNumConfigurations 1
How would I build my usbhd.usermap file?
Regards, Ugo
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
David Ferreira wrote:
Hi
If Device 009 is your USB HD, then, your /etc/hotplug/usb/usbhd.usermap sould look like that:
#usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info usbbackup 0x0003 0x04fc 0x0c25 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
Well, now the script. only one question, Do you use backup exec to write on linuxbox fs and then, rsync to the usb hd?, or do you want to backup exec directly backup to the usb hd? If you do a rsync from local linux fs to the USB disk, you can umount the fs in the script when it's finish. If you choose the second option (Backup diretly to the usb hd) you sould find other way to umount the usb drive once you have finished backup (I think the easiest way is a cron job). I think first option is beter, so you can use this pseudo-script in /etc/hotplug/usb/usbhd:
#!bin/bash mount -t auto /dev/sd0 /mnt/backup rsync -Pavz --delete /tmp/backup /mnt/backup umount /mnt/backup
If you prefere second option, you must made accesible /mnt/backup as you prefer to your windows box, quit rsync and umount from script, and create a cron job to umount the usb drive. I think now is enough clear what do you have to do.
Yes, I'd rather use the 2nd option, as the USB HDDs' size is 250 GB, while I only have about 100 GB locally.
Therefore, I only need the first line, so that it is automatically mounted? In fact, what I want is to always have /dev/sda1 mounted as /mnt/usbbackup (example) as soon as it is connected.
My backup usually takes about 5 hours, so if I start it at 19.00, it will be safe to umount the volume anytime after 4AM, for example, using a cronjob.
Does this make sense?
Is there a way to test it w/o being on site (one HDD is already connected).
Regards, Ugo
Ugo Bellavance wrote:
David Ferreira wrote:
Hi
If Device 009 is your USB HD, then, your /etc/hotplug/usb/usbhd.usermap sould look like that:
#usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info usbbackup 0x0003 0x04fc 0x0c25 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
Well, now the script. only one question, Do you use backup exec to write on linuxbox fs and then, rsync to the usb hd?, or do you want to backup exec directly backup to the usb hd? If you do a rsync from local linux fs to the USB disk, you can umount the fs in the script when it's finish. If you choose the second option (Backup diretly to the usb hd) you sould find other way to umount the usb drive once you have finished backup (I think the easiest way is a cron job). I think first option is beter, so you can use this pseudo-script in /etc/hotplug/usb/usbhd:
#!bin/bash mount -t auto /dev/sd0 /mnt/backup rsync -Pavz --delete /tmp/backup /mnt/backup umount /mnt/backup
If you prefere second option, you must made accesible /mnt/backup as you prefer to your windows box, quit rsync and umount from script, and create a cron job to umount the usb drive. I think now is enough clear what do you have to do.
Yes, I'd rather use the 2nd option, as the USB HDDs' size is 250 GB, while I only have about 100 GB locally.
Therefore, I only need the first line, so that it is automatically mounted? In fact, what I want is to always have /dev/sda1 mounted as /mnt/usbbackup (example) as soon as it is connected.
My backup usually takes about 5 hours, so if I start it at 19.00, it will be safe to umount the volume anytime after 4AM, for example, using a cronjob.
Does this make sense?
Is there a way to test it w/o being on site (one HDD is already connected).
The mount didn't work finally. I didn't have much time to test and I'm not on-site, so I decided so simply do a 'mount /dev/sda1 /mnt/usbbackup;service smb start' at 18:00 and the opposite at 3AM.
I start my backup job at 20:00 so I should be fine.
Thanks,
Ugo
On Tue, 20 Nov 2007 06:43:54 -0500 Ugo Bellavance ugob@lubik.ca wrote:
Hi,
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
I can't answer on the auto mounting however, consider this - Run something like BackupPC on the Cent box. That in turn allows rsync to fetch from the Windows Server without the extra overhead of samba etc.
We use BackupPC to archive many Linux and Windows Servers using the rsync method within BackupPC - I suggest BackupPC assuming you want a nice graphical front-end.
Chris wrote:
On Tue, 20 Nov 2007 06:43:54 -0500 Ugo Bellavance ugob@lubik.ca wrote:
Hi,
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
I can't answer on the auto mounting however, consider this - Run something like BackupPC on the Cent box. That in turn allows rsync to fetch from the Windows Server without the extra overhead of samba etc.
Ok, but we already have Backup Exec on the server, that can backup exchange, brick-level and full information store, system state, etc.
I'm just looking for a way to be able to have backupExec to write to the external drive.
Regards,
Ugo
On Tue, 20 Nov 2007 07:18:12 -0500 Ugo Bellavance ugob@lubik.ca wrote:
Chris wrote:
On Tue, 20 Nov 2007 06:43:54 -0500 Ugo Bellavance ugob@lubik.ca wrote:
Hi,
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
I can't answer on the auto mounting however, consider this - Run something like BackupPC on the Cent box. That in turn allows rsync to fetch from the Windows Server without the extra overhead of samba etc.
Ok, but we already have Backup Exec on the server, that can backup exchange, brick-level and full information store, system state, etc.
I'm just looking for a way to be able to have backupExec to write to the external drive.
Understood - Since you are using Exchange, brick-level restores are important. Oh well, just a thought.
On Tue, 20 Nov 2007, Ugo Bellavance wrote:
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
This is a very good question. I always wanted a system like this:
- A program is hooked into the system's messagebus (dbus) - It understands when a certain USB disk is attached that this is a backup disk (either based on ID or media name or something else) - When the disk is connected, it wil automatically trigger an rsnapshot backup with the current timestamp - After it has finished it displays a graphical pop-up (or a wall message to all consoles) that the backup is finished and the disk can be unplugged.
I am looking for a tool that can do this (both on Windows and on Linux). If such a tool exists in Open Source it would making backups very easy for companies or my mom and dad. (It is up to them in what frequency they make the backup, the default policy however is pretty broad)
I think It's very easy to do what you said using the hotplug facility and simple bash scripting. I've a system in one server that when you plug the USB disk, it mounts the disk, make a rsync which certain directories of the local file system, umount the drive, and send a email which logfile (you can use a wall if you prefere). Now I'm working in a system based on these and LVM, to take snapshots of live filesystems using wonderful facility provided by LVM that is snapshots.
If you want to know more, feel free to ask me.
Greetings, David
This is a very good question. I always wanted a system like this:
- A program is hooked into the system's messagebus (dbus)
- It understands when a certain USB disk is attached that this is a backup disk (either based on ID or media name or something else)
- When the disk is connected, it wil automatically trigger an rsnapshot backup with the current timestamp
- After it has finished it displays a graphical pop-up (or a wall message to all consoles) that the backup is finished and the disk can be unplugged.
I am looking for a tool that can do this (both on Windows and on Linux). If such a tool exists in Open Source it would making backups very easy for companies or my mom and dad. (It is up to them in what frequency they make the backup, the default policy however is pretty broad)
On Nov 20, 2007 12:43 PM, Ugo Bellavance ugob@lubik.ca wrote:
Hi,
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
Longtime ago, I did the some on a ZIP drive. I used "automountd" I think, I'm sure about "auto" not about the remainder The ZIP drive was unmounted when unused for more than 5min. And remounted when trying to access is mounting point.
I googled a little but did not find anything.
Otherwhise you can suppose your employee will change the tape at a know time and add a script in the cron to dismount 1H before.
Also you con dismount the drive using "plink" utility from window's putty package, from your windows server, when your backup is done!
Thanks, Ugo
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
This is autofs package
The automount program is used to configure a mount point for autofs, the inlined Linux automounter. automount works by taking a base mount-point and map file, and using these (combined with other options) to automatically mount filesystems within the base mount- point when they are accessed in any way. The filesystems are then autounmounted after a period of inactivity.
On Nov 20, 2007 1:23 PM, Alain Spineux aspineux@gmail.com wrote:
On Nov 20, 2007 12:43 PM, Ugo Bellavance ugob@lubik.ca wrote:
Hi,
I'm trying to implement this:
I have:
- A windows 2000 server
- A centos 4 server
- Monday, Tuesday, Wednesday, Thursday, Friday, Monthly.
The tape drive in the windows server died recently and I decided to switch to USB external drives. However, the USB controller in the windows server is only 1.1, so it is very slow.
I didn't want to install a 2.0 USB controller in the windows server since it is a brand-name and I didn't want to make it unstable, so I decided to make the backups of the windows server (using Backup Exec) on the linux box.
So backup exec writes on the linux box via samba, directly on the USB drive. (I thought of writing on the linux box FS directly, then rsync'ing to the USB drive), but the space available on the local FS is about 90 gigs while the external USB drives are 250 gigs, meaning that I can keep like 4 weeks of data on the USB drives (using backup exec settings), while I could only keep 1 or 2 weeks otherwise.
My questions is:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
Longtime ago, I did the some on a ZIP drive. I used "automountd" I think, I'm sure about "auto" not about the remainder The ZIP drive was unmounted when unused for more than 5min. And remounted when trying to access is mounting point.
I googled a little but did not find anything.
Otherwhise you can suppose your employee will change the tape at a know time and add a script in the cron to dismount 1H before.
Also you con dismount the drive using "plink" utility from window's putty package, from your windows server, when your backup is done!
Thanks, Ugo
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
-- Alain Spineux aspineux gmail com May the sources be with you
--On Tuesday, November 20, 2007 6:43 AM -0500 Ugo Bellavance ugob@lubik.ca wrote:
-how can the USB drives be umounted/mounted automatically when the person on site changes it (monday to tuesday, for example). There will always be only one HDD conected at the time.
This howto is targeted at Bacula users, but you might be able to adapt parts of it to your problem:
http://sourceforge.net/docman/display_doc.php?docid=47704&group_id=50727