Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After tar.gz'ing a 25 GB folder, I copied the file from my local machine to a remote server via scp.

Once the file was transferred, I failed to extract the tar.gz due to:

$ tar -zxvf dump.tar.gz
myFolder/
myFolder/myFile1        

tar: myFolder/myFile: Wrote only 9728 of 10240 bytes

myFolder/myFile2
tar: myFolder/myFile2: Cannot write: No space left on device
tar: Exiting with failure status due to previous errors

Then, I ran df -h to see that the disk is "100%" full:

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_00-lv_root
                       16G   15G   28M 100% /
tmpfs                 7.9G  136K  7.9G   1% /dev/shm
/dev/sda1             485M  131M  329M  29% /boot
/dev/mapper/vg_00-lv_opt
                      7.3G  152M  6.8G   3% /opt
/dev/mapper/vg_01-lv_u01
                      148G  6.4G  134G   5% /u01

Can I specify scp to write to the dev/mapper/vg_01-lv_u01 disk drive since it has enough space? How can I solve this issue?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You are asking about scp but the problem of writing to a full device appeared with tar.

I understand the question that you want to copy the file(s) to the filesystem on the dev/mapper/vg_01-lv_u01 volume. For this you must use the mount point /u01 as the destination.

scp

scp dump.tar.gz user@machine:/u01/any/existing/path

This way you specify the destination path in the mount point of the volume you want to use.

tar

tar allows you to specify the destination directory for extraction too.

tar -zxvf dump.tar.gz -C /u01/any/existing/path

combination

If you use the tar file just for the transport you can use a more direct way to pipe it directly through ssh:

tar -cf - /source/directory | ssh user@machine "tar -xf - -C /u01/any/existing/path"

If you use compression with ssh, the compression with tar will not probably be needed. Anyway you can enable the compression anytime by putting the z option of tar back.

share|improve this answer
    
Thanks. Since I already have the tar.gz transferred, could I just mv it to /u01/...? –  Kevin Meredith Oct 7 '13 at 9:43
    
@Kevin: You are welcome. Yes, of course, you can move the file to the other filesystem. If you do not need to keep the archive, you can directly extract and remove it: tar -zxvf dump.tar.gz -C /u01/any/existing/path && rm dump.tar.gz Edit: I have changed the commands here so that rm is executed only after successful extraction of the archive. –  pabouk Oct 7 '13 at 12:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.