Help syntax to restore partition from ftp


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help syntax to restore partition from ftp
# 1  
Old 07-25-2012
Help syntax to restore partition from ftp

Hi, I found info on the internet to backup a partition to ftp.
But I am unable to properly format the syntax to restore the partition.
This is being done from a ssh logged in session to a server booted with a liveCD.

backup:
Code:
dd if=/dev/sda5 bs=2048 conv=noerror,sync | lftp -u user,passwd ftpsiteIP -e "put /dev/stdin -o servbak5.img; quit"


restore:
Code:
lftp -u user,passwd ftpsiteIP -e "get /dev/stdin -o servbak5.img; quit" | dd of=/dev/sda5

Can someone help with the restore syntax please?

Cheers
Chang-li

Last edited by chang-li; 07-25-2012 at 01:10 PM..
# 2  
Old 07-25-2012
Hi,

First just a quick bit of site etiquette, please use code tags - it makes things easier to read.

Now the problem, does the live CD actually know about the partition table? And what if any errors are you getting?

Regards

Dave
# 3  
Old 07-25-2012
I believe the LiveCD does know. We check the structure with
Code:
fdisk -l

and we can see all the partions listed properly for all drives. That is how we knew what to backup.

The error when we run the restore command, is that a file copy occurs, but it is taking the servbak5.img and copying it directly to root of livecd, and survives a reboot. It then runs out of disk space and our logged in session freezes.

chang-li
# 4  
Old 07-25-2012
You can't write to standard input. -o /dev/stdout? You might also need to reverse the order there.
Code:
get servbak5.img -o /dev/stdout

# 5  
Old 07-25-2012
Hi,
I tried your code...no luck.
I get the following error:


Quote:
get: /dev/stdout: File exists
0+0 records in
0+0 records out
0 bytes (0 B) copied, 6.65242 s, 0.0 kB/s
regards
Chang-li
# 6  
Old 07-25-2012
Just hunting for stdout in lftp's manual page found the answer -- using cat instead of get should send the file to standard output.
# 7  
Old 07-25-2012
Corona688

Thanks . That seems to be doing it. I see via the ftp server the upload going, but am not able to see any indication of activity via my terminal ssh window.
I was able to see activity when i did the original backup to the ftp server.

would adding a pipe like 'PV' to the equation help to get a visual indication of activity?

Thanks for the assistance so far. At least it's working.Smilie

Chang-li
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies

2. Filesystems, Disks and Memory

Ask concept soft partition vs hard partition

Hi Experts I would like to know different between soft partition concept and hard partition concept on solaris. Here is little explanation between soft partition concept and hard partition concept on solaris. Soft Partition: 1TB total space available in storage in all mapped to the OS to... (2 Replies)
Discussion started by: edydsuranta
2 Replies

3. Shell Programming and Scripting

Help Simple FTP Script Here Syntax

I have a list of IP address and want to be assess whether FTP is allowing FTP access. I don't want to use lousy NT shell, but cannot get the syntax down on this. ftphosts.txt is a simple list of IP adresses. I want to iterate through the IPS and do a simple ftp IPadress user ftp password... (15 Replies)
Discussion started by: gdotoli
15 Replies

4. Solaris

Partition overlaps another partition while creating new parition in solaris

hi all while formatting hard disk i am getting following error. Partition 1 ends at 266338338 It must be between 34 and 143374704. label error: EFI Labels do not support overlapping partitions Partition 8 overlaps partition 1. Warning: error writing EFI. Label failed. I have formatted the... (2 Replies)
Discussion started by: nikhil kasar
2 Replies

5. UNIX for Dummies Questions & Answers

User ID syntax to FTP to Windows

Hello, I have searched the forums and may not be putting in the right keywords, but hopefully someone will be kind enough to help... It's been awhile since I've ftp'd to a Windows server, but no matter how I try to connect, it will not let me, although I have no issues setting up a connection... (1 Reply)
Discussion started by: tekster757
1 Replies

6. AIX

mksysb restore - Wrong OS level for restore

Hi all, I am still working on my mksysb restore. My latest issue is during an alt_disk_install from tape I got the following error after all the data had been restored. 0505-143 alt_disk_install: Unable to match mksysb level 5.2.0 with any available boot images. Please correct this... (0 Replies)
Discussion started by: pobman
0 Replies

7. UNIX for Dummies Questions & Answers

FTP - switching user syntax

Running the following shell script, #!/usr/bin/ksh set -x swdofile=/opt/SWDO_IN1V01P001_1.csv USER='myusername' PASSWD='mypassword' HOST='myhostname' ftp -n $HOST << SCRIPT quote USER $USER quote PASS $PASSWD su - BRA -c put $swdofile quit SCRIPT exit 0 but not managing to get the... (1 Reply)
Discussion started by: daveaasmith
1 Replies

8. HP-UX

Syntax problem with Unix ftp get command

An outside vendor has staged 2 batch files for us and I've tried to retrieve the files using the commands that they've indicated I could use to retrieve one file at a time. I've tried using this command in a shell script after a successful connection to their server: get "$$ ID=IL096869 BID='PGP... (2 Replies)
Discussion started by: mheinen
2 Replies

9. UNIX for Dummies Questions & Answers

I've created a partition with GNU Parted, how do I mount the partition?

I've created a partition with GNU Parted, how do I mount the partition? The manual information at http://www.gnu.org/software/parted/manual/parted.html is good, but I am sure about how I mount the partition afterwards. Thanks, --Todd (1 Reply)
Discussion started by: jtp51
1 Replies

10. UNIX for Dummies Questions & Answers

understanding logical partition, physical partition

hi, 1) is logical partition the same as physical partition except that one is physical and the other is logical? 2) then it must a one to one ratio? (3 Replies)
Discussion started by: yls177
3 Replies
Login or Register to Ask a Question