General :: Locate Second Disk Path From Ssh And Copy A Folder To It?
Jun 9, 2010
I own a web server (centos 64bit with cpanel on it) and my datacenter add me a second hard disk and i want first to locate from ssh where is it (the path) and then to copy my mysql folder /var/lib/mysql to the new disk and have it like this /new/mysql on the second disk.
Is there a way to recreate all the folders from one directory to another without copying over the contents of the folder? I've been trying to do something like this,
Code:for i in `ls $X`; do mkdir $PATH/$i; doneUnfortunately $i is deliminated by whitespaces in the filenames and not the actual folders.
$X contains only other folders so I dont have to worry about regular files but any kind of more "advanced" solution would work.
What do I need to add to my .emacs to get it to save all of my autosaves and backups into one directory? I don't do a lot of .emacs configuration, and I just can't get the variables out of emacsWiki to play right. Anybody mind sharing how they do it? I would prefer to have the saves placed in /tmp/emacs/{username}/{autosaves | backups}
I am trying to zip a directory but when I zip and unzip it, it contains the whole path of the variable "album". I would just like to zip the last folder in the path. Here is what I have now. I tried basename but that didn't seem to work, possible I just can't make it work right.
I know there are many threads about recovering damaged superblocks. I've spent 3 evenings reading them and trying what they suggest. Invariably the commands do nothing except to report bad or missing superblocks. I've removed the physical disk from the machine and am working with a dd image file (/mnt/image). I can mount what used to be hdc1 and read its files with no problem. I'm trying to recover partions hdc6 and hdc7.$ mmls /mnt/image -b
DOS Partition Table Offset Sector: 0 Units are in 512-byte sectors
I have configured 3 drives on my machine.sda1 less than 10 GBsda2 less than 10 GBsda3 450 GBI have installed a software in /usr/share/MyApplicationand as I see /usr/share stays at sda2 and only 2 Gb is free but my application needs more than 3 GB free to run because it creates a temporary file greater than 3 GB during execution.Knows anybody any way how to make MyApplication stays in sda3 drive.
S.M.A.R.T.tells me my primary fedora drive has lots of bad blocks,so I ordered a used identical drive from ebay.I want to do the very basic process of making a full backup of my existing drive - so as to replace it with a more or less identical replacement. Logically identical - not necewsarily sector to sector identical.im not literate in unix and its children - and seem to find a plethora of descriptinos of how to do what I want to do. which is
1. format the drive - what you may call low level format - ie op sys independent.
2. create a partition system compatible with my existing disk.
3. copy everything from my existing disk to the new disk.
4. put existing disk on the shelf as a backup and start to use new disk.
Im writing a script that extracts part of the path name:I drop a file in terminal and set the directory name of the file to x using dirname $0note: ( directory is different every time since not all files are from the same location)
ex. x="/home/Downloads/yesterday/photo/.../image.png" /image.png /.../ means I dont know the name of folders between but I know the path name always starts
I installed Kubuntu 9.1 and then I downloaded Xampp of Linux to the desktop, however I have to extract it to /Opt/lampp. And that's the problem. I don't seem to have access or permissions to ?? I tried right-click | properties | permissions but the fields are greyed-out to make any changes.I am logged-in using the same user id/password I created when installing K9.1.
I have an Dell Inspiron 1300 laptop operating Windows XP SP3 on a 40 GB hard drive and an 250GB USB Seagate External Expansion Portable Drive, partitioned into two equal sections. I downloaded and burned Ubuntu 9.10 to a CD. I booted up from the CD and installed Ubuntu on one part of the Expansion Drive. When it was completed, I shut down my laptop, unplugged the Expansion Drive and ate dinner.
Later on and came back and turned on my laptop. When I turned it on, I received this message:
GRUB loading, error: no such disk grub rescue>
With my external hard drive plugged in, I am able to see the full GRUB menu listing the Ubuntu install as well on the external hard drive, and the windows XP install on my internal hard drive.
Without my external drive plugged it, my laptop fails to XP. It goes straight to:
GRUB loading, error: no such disk grub rescue>
The part I don't understand is why it i looking for GRUB on my internal hard drive when I installed Ubuntu on an external hard drive.
Windows XP is only installed on the 40 GB hard drive, which is the internal drive. The 250GB USB Seagate External Expansion Portable Drive, partitioned into two equal sections, has Ubuntu install on one of the partitions. The other partition is blank.
When I connected the expansion drive to my laptop, GRUB starts up and I can choose from using Ubuntu or Windows. The laptop was given to me as a hand-me-down, so I do not have a copy of Windows XP, nor can I locate a copy to repair the MBR on my laptop. Is there a way I can fix what has happened so I can normally boot Windows without needing to plug in my expansion drive?
Here is some additional information that I hope helps. This is what my GRUB menu looks like when the external HD is connected:
Ubuntu Linux 2.6.31-14 generic Ubuntu Linux 2.6.31-14 generic (recovery mode) Memory Test (memtest86+) Memory Test (memtest86+) serial console 115200 Dell Utility Partition (on /dev /sda1)
I downloaded the bin file, and installed it but I haven't realized that I made the folder in the current directory. I would like to install in /usr/java.
Can I now just copy paste it there. Or I need to re-install to desired location I installed JRE , is that ok or I need to install sdk
I want to move a folder from USB drive to desktop, any directory, let say usr directory. But don't know what the name for usb drive and where to find it, i know i am going to use mv command.
I have a 160GB harddrive which I installed a F12, would like to upgrade to a bigger drive, but I hate to have to re-install everything.
Recommend a good disk copy utility? The utility should be able to not only copy files, but boot sector and everything. So I just need to make a copy, change my BIOS to boot from the new drive and run everything as before.
I'm trying to copy a list of files except the files which has ".log" in the filename to another folder.I can run it correctly when I am located in the Source folder, but not when I am in any other location.cd /home/me/Sourcels /home/me/Source -1|grep -v "^.*log$" |xargs -n 1 -iHERE cp -r HERE /home/me/DestinationHow can I indicate both Source and Destination Folder?
sudo cp ../../../rootfs_maker_ramdisk drivers/filesystem/ -rf give below errorCode:cp: cannot create special file ...._rootfs/dev/hda4': No such device or addressi get this error only in some specific locationsif i dont use sudo then i get permission denied msg
Does anyone know if this is possible? I am attempting to copy one "master" hard drive to two or more "destination" drives. I hope to use the DD command because the master drive is encrypted and I need to make exact copies to "destination" drives.
I have used dd if=/dev/sda of=/dev/sda and it works for one-to-one operations. I tried dd if=/dev/sda of=/dev/sdb of=/dev/sdc but the command skips the of=/dev/sdb and copies to sdc....I knew that was going to be too easy
i want make a bash panel and i want he will copy files from orginal folder to $user folder i mean when for explame i type i want install some server he say cp: cannot stat 'root/Desktop/2/files/beckup/sa-mp-steam': No such file or directory.
I have 500 folders of templates in one folder. Now each folder has file called template_thumbnail.png . now i want something so that all those files get copied to one folder with name same as the home folder name
I have cygwin installed and i can copy that folder in there so basically it will linux shell script
The reason I ask is, we have a home server running Fedora 12. I would like to be able to let anyone just plug in a flashdrive, and have Fedora automatically grab and copy all the files on that flashdrive to a specific share.
make a simple script to copy files from my "hfiles " directory to a "www" folder at leats I think its a directory, it has the permissions as "lrwxrwxrwx " but its like a public branch So I proceeded to make a file entittled MkPublic to copy the "hfiles" directory to the "www" branch
here is the code i used:
#!/bin/sh # COPIES FILES echo "copying files"
[code]....
when i try to run the script it tells me that there is a syntax error and an unexpected end of file and nothing seems to get copied anywhere so clearly there is something wrong with one im doing, i tried multiple ways : using the quotes, spacing the equal signs, but I seem to still get the same results.
I had a situation in which the the path of the file to be copied is written in other file and I had to copy it using shell script..I can use cp $(cat /home/robert/location.txt) /media/sda1 on normal linux shell...But I am using buildroot script where $(cat /home/robert/location.txt) evaluate to nothing..is just blank..