Some issues with the clone script

Discussion of the Meteohub software package

Moderator: Mattk

Post Reply
mvpel
Senior Boarder
Senior Boarder
Posts: 42
Joined: Fri Mar 14, 2008 1:38 pm
Location: Merrimack, NH, US

Some issues with the clone script

Post by mvpel »

Its failure modes aren't really very good.

For instance, if the system doesn't recognize that the /dev/sdb device is not available, it will copy the entire /data partition over to /mnt on the root filesystem of the main memory stick, potentially filling it up and wedging things.

The clone script should, at least, check to be sure that the mount of /dev/sdb3 onto /mnt succeeded, perhaps by parsing the /etc/fstab or df output, before proceeding with the tar.

Better yet, it should check if /dev/sdb is actually attached before doing anything.

Also, it'd be useful if the clone function could use /usr/bin/logger or some such to provide some more detailed information on how the clone process is working at each step of the way.

Also, there appears to be two copies of the /data:


(/bin/dd if=/dev/sda1 of=/dev/sdb1 bs=1M;

/bin/mount /dev/sdb3 /mnt;

cd /data;
/bin/tar cplf - . | (cd /mnt; /bin/tar xfp -);
/bin/tar cplf - . | (cd /mnt; /bin/tar xfp -);

/sbin/shutdown -h now)&

Why is this?
Chill
Expert Boarder
Expert Boarder
Posts: 151
Joined: Fri Feb 15, 2008 6:38 pm

Re:Some issues with the clone script

Post by Chill »

Hi there..

I'm a bit lost! Has your message any relationship with CLONE feature?

Why are you focussing in the script? Or, can I access the script? Or must I use this script in order to be able to CLONE a USB stick?

Could you please give me some light on it? As said, I can't deeply understand the meaning of your message... :blush:

Cheers,
Chill
skyewright
Platinum Boarder
Platinum Boarder
Posts: 873
Joined: Fri Jan 25, 2008 6:27 pm
Location: Isle of Skye, Scotland

Re:Some issues with the clone script

Post by skyewright »

Chill wrote:As said, I can't deeply understand the meaning of your message... :blush:
It's about a behind the scenes, technical, thing.

To the user, cloning is just something that happens.

Behind the scenes there needs to be a series of detailed instructions that define and control the process (just as is the case for all the other Meteohub features).

mvpel has the knowledge and experience to be able to reach, study and comment on those instructions. That's what he's doing here.

If you don't understand those details, don't worry about it. Most people are happy enough to drive a car without knowing all the details of how it works. Software is pretty much the same. Just think of this as mechanics chatting over getting some extra bit of performance out of their machines. :)

Does that make sense?
mvpel
Senior Boarder
Senior Boarder
Posts: 42
Joined: Fri Mar 14, 2008 1:38 pm
Location: Merrimack, NH, US

Re:Some issues with the clone script

Post by mvpel »

Yep, that's about the size of it.

I'll see if I can make some time this weekend to rewrite the clone script in Perl, and set up a progress window in the web browser.
Chill
Expert Boarder
Expert Boarder
Posts: 151
Joined: Fri Feb 15, 2008 6:38 pm

Re:Some issues with the clone script

Post by Chill »

skyewright wrote:Does that make sense?
Sure it does!

Point is I didn't understand if it was a deeper reason reason with the message... for meteohub regular users....

I write programms everyday ;) but I must admit PERL is far away from my knowledge, may be in the future.

But since Boris pushed me to SSH I thought it could help me...


Thanks for your answer, anyway...

Chill
Post Reply