Re: [SLUG] Tape Backups and Scripting

2011-06-08 Thread Matthew Hannigan
On Mon, Jun 06, 2011 at 06:25:29PM +1000, Rick Phillips wrote:
  [ .. ]
 I have looked at Bacula (a pain to install on CentOS 5.6) and had a

amanda and bacula are available for centos -- bacula is in EPEL

I would strongly suggest you use an existing backup system rather than roll 
your own

If you use tar, at least set the blocking high to increase performance.
There's a probably a million other details that are builtin knowledge to 
existing backup systems.

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] Tape Backups and Scripting

2011-06-08 Thread James Gray

On 07/06/2011, at 5:31 PM, Rick Phillips wrote:
 I removed the /sys folder from the script that I wrote and everything
 went fine.  I have not tried your script rewrite fully yet as we had a
 number of other disasters today and time was against me but I will try
 it as soon as I can.

Cool - glad it's ticking along, but sorry to hear about the other probs.  Hope 
you get it all ironed out :)

 Actually, I really appreciated your elegant rewrite of my original and I
 have learned a lot from that.  I really must get smarter when writing
 these things.  My problem is that I will start with a couple of lines
 and then keep tweaking it and next thing I know I have a monster written
 in the form I displayed.  That means I should pre-plan what I am
 attempting to do and then write the script more elegantly.

Heheh - no problems.  I know what you mean; simple one liner turns into a 
little script which morphs into franken-script from hell!  I try to make sure 
all my scripts follow a predictable pattern:

1. hash-bang line (bash/perl/awk/whatever)
2. check running user if appropriate
3. define variables (if needed...usually better to use them regardless)
4. define functions (if needed)
5. Do the work :)
6. Log/notify about results (if needed)

Not all sections are needed all the time, but I normally use #1, #3 and #5 (and 
there are times I leave #1 out - if it's called by another script for example).

 Thanks again for taking the time to give me a lesson in better
 coding/scripting.

You're very welcome :)  I know the function to start/stop services and the 
supporting variable with service names was overkill, but I thought if you saw 
how functions work in bash it might be a new tool you can use.  Glad I was able 
to help out.

I know you've opted for a roll-your-own, and there's no real harm in that, but 
I agree with others here; the small time/effort investment in something like 
bacula will pay dividends.  Bacula has a great webmin module (www.webmin.com) 
which makes administration a doddle if you want to avoid config files and 
command line console.  There's also a featureful GTK administration tool called 
BAT (Bacula Admin Tool - http://wiki.bacula.org/doku.php?id=bat).  Lastly, as 
others have pointed out, there are a lot of performance tuning gotchas with 
roll-your-own solutions that are normally pre-configured with tools like bacula.

Take care,

James

smime.p7s
Description: S/MIME cryptographic signature
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

[SLUG] PC won't recognise boot disk

2011-06-08 Thread Kyle
 2 or 3 yr old pc running SiS-661 chipset, celeron and 1GB. So your 
average every day bog standard pc with an 80GB IDE HDD.


Ubuntu 10.10 runs fine from live CD, albeit a bit slow. Even installs 
fine, albeit slow.


Used to dual-boot XP / Ubuntu till me dear sweet mother asked me to add 
in an old disk of hers formatted in FAT32. Suddenly, it popped up with;


Boot disk priority has changed. Please enter setup to check bla blah 
blah.  Never booted since.


FAT32 disk since removed. Original disk wiped, partition table wiped, 
reinstalled Ubuntu only. MBR zeroed out and full OS re-install.


And the bloody thing STILL won't find the OS on boot. Does POST, finds 
HDD + 2 CD's, tries to boot from CD, then comes;


DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

Boot from live cd again; run fdisk, far as fdisk concerned all 
partitions there with sda1 marked as boot. MEMTest all good. Everything 
seems right. Only peculiarity I can see is despite wiping partition 
table and writing empty table to re-boot again from disc, is when 
creating partitions it gives me sda1, sda5 (swap) and sda6 (/). What 
happened to sda's 2, 3  4?


BIOS shows this disc as first in HDD boot order after CD's.

Can anyone offer any suggestions as to why this thing simply refuses to 
locate the boot partition please?


--

Kind Regards

Kyle

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread Ben Donohue

Hi Kyle,

The primary or boot partition is not set to active.

Use a tool like a boot disk or anything that can set the boot partition 
to active partition.


Thanks,
Ben Donohue


On 8/06/2011 9:54 PM, Kyle wrote:
 2 or 3 yr old pc running SiS-661 chipset, celeron and 1GB. So your 
average every day bog standard pc with an 80GB IDE HDD.


Ubuntu 10.10 runs fine from live CD, albeit a bit slow. Even installs 
fine, albeit slow.


Used to dual-boot XP / Ubuntu till me dear sweet mother asked me to 
add in an old disk of hers formatted in FAT32. Suddenly, it popped up 
with;


Boot disk priority has changed. Please enter setup to check bla blah 
blah.  Never booted since.


FAT32 disk since removed. Original disk wiped, partition table wiped, 
reinstalled Ubuntu only. MBR zeroed out and full OS re-install.


And the bloody thing STILL won't find the OS on boot. Does POST, finds 
HDD + 2 CD's, tries to boot from CD, then comes;


DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

Boot from live cd again; run fdisk, far as fdisk concerned all 
partitions there with sda1 marked as boot. MEMTest all good. 
Everything seems right. Only peculiarity I can see is despite wiping 
partition table and writing empty table to re-boot again from disc, is 
when creating partitions it gives me sda1, sda5 (swap) and sda6 (/). 
What happened to sda's 2, 3  4?


BIOS shows this disc as first in HDD boot order after CD's.

Can anyone offer any suggestions as to why this thing simply refuses 
to locate the boot partition please?



--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread Ben Donohue

Hi again Kyle,

partitions on x86 hardware go like the following...

partition1 = primary = sda1
partition2 = primary = sda2
partition3 = primary = sda3
partition4 = primary = sda4
partition5 = extended  = sda5 (living inside of one of the primary 
partitions)
partition6 = extended  = sda6 (living inside of one of the primary 
partitions)

etc.

So you have a sda1 and possibly a sda4 with nothing else in it except 
sda5 and sda6.

So you only see sda1 (primary) and sda5 and sda5 as (extended) partitions.

Thanks,
Ben Donohue


On 8/06/2011 9:54 PM, Kyle wrote:
 2 or 3 yr old pc running SiS-661 chipset, celeron and 1GB. So your 
average every day bog standard pc with an 80GB IDE HDD.


Ubuntu 10.10 runs fine from live CD, albeit a bit slow. Even installs 
fine, albeit slow.


Used to dual-boot XP / Ubuntu till me dear sweet mother asked me to 
add in an old disk of hers formatted in FAT32. Suddenly, it popped up 
with;


Boot disk priority has changed. Please enter setup to check bla blah 
blah.  Never booted since.


FAT32 disk since removed. Original disk wiped, partition table wiped, 
reinstalled Ubuntu only. MBR zeroed out and full OS re-install.


And the bloody thing STILL won't find the OS on boot. Does POST, finds 
HDD + 2 CD's, tries to boot from CD, then comes;


DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

Boot from live cd again; run fdisk, far as fdisk concerned all 
partitions there with sda1 marked as boot. MEMTest all good. 
Everything seems right. Only peculiarity I can see is despite wiping 
partition table and writing empty table to re-boot again from disc, is 
when creating partitions it gives me sda1, sda5 (swap) and sda6 (/). 
What happened to sda's 2, 3  4?


BIOS shows this disc as first in HDD boot order after CD's.

Can anyone offer any suggestions as to why this thing simply refuses 
to locate the boot partition please?



--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread Kyle

 Ben,

thanks the info, but that's apparently not it. Or so it would seem. 
According to both fdisk and GParted  from the liveCD, the boot flag is 
set on sda1 (/boot).


P.S. Thanks for the lesson on partition numbering.


Kind Regards

Kyle


On 08/06/11 10:04 PM, Ben Donohue wrote:

Hi Kyle,

The primary or boot partition is not set to active.

Use a tool like a boot disk or anything that can set the boot 
partition to active partition.


Thanks,
Ben Donohue


On 8/06/2011 9:54 PM, Kyle wrote:
 2 or 3 yr old pc running SiS-661 chipset, celeron and 1GB. So your 
average every day bog standard pc with an 80GB IDE HDD.


Ubuntu 10.10 runs fine from live CD, albeit a bit slow. Even installs 
fine, albeit slow.


Used to dual-boot XP / Ubuntu till me dear sweet mother asked me to 
add in an old disk of hers formatted in FAT32. Suddenly, it popped up 
with;


Boot disk priority has changed. Please enter setup to check bla blah 
blah.  Never booted since.


FAT32 disk since removed. Original disk wiped, partition table wiped, 
reinstalled Ubuntu only. MBR zeroed out and full OS re-install.


And the bloody thing STILL won't find the OS on boot. Does POST, 
finds HDD + 2 CD's, tries to boot from CD, then comes;


DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

Boot from live cd again; run fdisk, far as fdisk concerned all 
partitions there with sda1 marked as boot. MEMTest all good. 
Everything seems right. Only peculiarity I can see is despite wiping 
partition table and writing empty table to re-boot again from disc, 
is when creating partitions it gives me sda1, sda5 (swap) and sda6 
(/). What happened to sda's 2, 3  4?


BIOS shows this disc as first in HDD boot order after CD's.

Can anyone offer any suggestions as to why this thing simply refuses 
to locate the boot partition please?



--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread peter
 Kyle == Kyle  k...@attitia.com writes:

Kyle   Ben, thanks the info, but that's apparently not it. Or so it
Kyle would seem.  According to both fdisk and GParted from the
Kyle liveCD, the boot flag is set on sda1 (/boot).

Sounds like the MBR is corrupt.  From your live CD use the install-mbr
program to reinstate it.

You'll *probably* need to say,
   install-mbr /dev/sda
if there's only one hard disc present.

Peter C
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread Jake Anderson

On 06/08/2011 09:54 PM, Kyle wrote:
 2 or 3 yr old pc running SiS-661 chipset, celeron and 1GB. So your 
average every day bog standard pc with an 80GB IDE HDD.


Ubuntu 10.10 runs fine from live CD, albeit a bit slow. Even installs 
fine, albeit slow.


Used to dual-boot XP / Ubuntu till me dear sweet mother asked me to 
add in an old disk of hers formatted in FAT32. Suddenly, it popped up 
with;


Boot disk priority has changed. Please enter setup to check bla blah 
blah.  Never booted since.


FAT32 disk since removed. Original disk wiped, partition table wiped, 
reinstalled Ubuntu only. MBR zeroed out and full OS re-install.


And the bloody thing STILL won't find the OS on boot. Does POST, finds 
HDD + 2 CD's, tries to boot from CD, then comes;


DISK BOOT FAILURE, INSERT SYSTEM DISK AND PRESS ENTER

Boot from live cd again; run fdisk, far as fdisk concerned all 
partitions there with sda1 marked as boot. MEMTest all good. 
Everything seems right. Only peculiarity I can see is despite wiping 
partition table and writing empty table to re-boot again from disc, is 
when creating partitions it gives me sda1, sda5 (swap) and sda6 (/). 
What happened to sda's 2, 3  4?


BIOS shows this disc as first in HDD boot order after CD's.

Can anyone offer any suggestions as to why this thing simply refuses 
to locate the boot partition please?


best method i've found to restore a disk that's acting funny if you 
don't care what's on it

dd if=/dev/zero of=/dev/sda bs=10M count=1

just write zeros to the first 10mb of the disk and start again ;-

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread K L
I have thrice now wiped the entire disk and re-installed, including physically 
zero-ing out the first 512 bytes (which I understand to be the MBR) so I 
would've expected the re-installs to deal with that. 

But happy to give this a go tonight when I get home.

- Original Message -
From: pe...@chubb.wattle.id.au
To: Kyle k...@attitia.com
Cc: slug@slug.org.au
Sent: Thursday, 9 June, 2011 9:22:44
Subject: Re: [SLUG] PC won't recognise boot disk

Sounds like the MBR is corrupt.  From your live CD use the install-mbr
program to reinstate it.

You'll *probably* need to say,
   install-mbr /dev/sda
if there's only one hard disc present.

Peter C
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread K L

Just thinking about it. I thought IDE HDD's were always recognised as 
/dev/hdx. But liveCD (in fact any boot program I use) is recognising this one 
as /dev/sda. 

What's going on there? 



I'll give that go too Jake, ta. Too late to save setup and settings. 


- Original Message -
From: Jake Anderson ya...@vapourforge.com
To: slug@slug.org.au
Sent: Thursday, 9 June, 2011 10:58:35
Subject: Re: [SLUG] PC won't recognise boot disk

best method i've found to restore a disk that's acting funny if you 
don't care what's on it
dd if=/dev/zero of=/dev/sda bs=10M count=1

just write zeros to the first 10mb of the disk and start again ;-

-- 
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread peter
 K == K L k...@attitia.com writes:

K I have thrice now wiped the entire disk and re-installed, including
K physically zero-ing out the first 512 bytes (which I understand to
K be the MBR) so I would've expected the re-installs to deal with
K that.  But happy to give this a go tonight when I get home.

Oh, if you're doing a reinstall, that's (slightly) different.  In that
case, check that the disk is visible in the BIOS --- especially if
you've fiddled around with the hardware.  sometimes the BIOS needs to
be re-told that it should be looked at to boot from.


K - Original Message - From: pe...@chubb.wattle.id.au To:
K Kyle k...@attitia.com Cc: slug@slug.org.au Sent: Thursday, 9
K June, 2011 9:22:44 Subject: Re: [SLUG] PC won't recognise boot disk

K Sounds like the MBR is corrupt.  From your live CD use the
K install-mbr program to reinstate it.

K You'll *probably* need to say, install-mbr /dev/sda if there's only
K one hard disc present.

K Peter C -- SLUG - Sydney Linux User's Group Mailing List -
K http://slug.org.au/ Subscription info and FAQs:
K http://slug.org.au/faq/mailinglists.html
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread peter
 peter == peter  pe...@chubb.wattle.id.au writes:

 K == K L k...@attitia.com writes:
K I have thrice now wiped the entire disk and re-installed, including
K physically zero-ing out the first 512 bytes (which I understand to
K be the MBR) so I would've expected the re-installs to deal with
K that.  But happy to give this a go tonight when I get home.

peter Oh, if you're doing a reinstall, that's (slightly) different.
peter In that case, check that the disk is visible in the BIOS ---
peter especially if you've fiddled around with the hardware.
peter sometimes the BIOS needs to be re-told that it should be looked
peter at to boot from.

(I see you've already done this.  Grrr.  I really should reread the
entire thread before replying).

The only think I can think is that when you're reinstalling Ubuntu
itfor some reason thinks there's already a boot sector at the start of
the disk and so isn't installing a new one.

Peter C




K - Original Message - From: pe...@chubb.wattle.id.au To:
K Kyle k...@attitia.com Cc: slug@slug.org.au Sent: Thursday, 9
K June, 2011 9:22:44 Subject: Re: [SLUG] PC won't recognise boot disk

K Sounds like the MBR is corrupt.  From your live CD use the
K install-mbr program to reinstate it.

K You'll *probably* need to say, install-mbr /dev/sda if there's only
K one hard disc present.

K Peter C -- SLUG - Sydney Linux User's Group Mailing List -
K http://slug.org.au/ Subscription info and FAQs:
K http://slug.org.au/faq/mailinglists.html
peter -- SLUG - Sydney Linux User's Group Mailing List -
peter http://slug.org.au/ Subscription info and FAQs:
peter http://slug.org.au/faq/mailinglists.html
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html


Re: [SLUG] PC won't recognise boot disk

2011-06-08 Thread Steve Kowalik

On 09/06/11 12:12, K L wrote:


Just thinking about it. I thought IDE HDD's were always recognised as 
/dev/hdx. But liveCD (in fact any boot program I use) is recognising this one 
as /dev/sda.

What's going on there?


This changed some time back (I can't recall the specifics, but it was in 
a 2.6.something kernel). All HDDs are now recognied as /dev/sdx, 
irregardless of their connection type.


Cheers,
--
Steve
Wrong is endian little that knows everyone but.
 - Sam Hocevar
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html