LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-02-2010, 02:03 PM   #1
nsk04
LQ Newbie
 
Registered: Jun 2010
Posts: 4

Rep: Reputation: 0
connect external hard disk to linux server


HI,
I have Red Hat linux server with update 8.

Explain me in detail how to connect external hard disk to linux server so that it will detect it. Also let me know how can i come to know whether the linux server has detected it.
Also how to copy the linux server harddisk content/data to this USB External hard disk
 
Old 06-02-2010, 02:15 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
1. plug it in
2. boot
3. check if it's automounted with "mount"
4. If not, mount it. It's probably /dev/sdX1 where X is a letter
5. use cp to copy files

It's probably that easy. If you run into problems then come back with details about exactly what you did and what errors you are receiving.
 
Old 06-02-2010, 09:12 PM   #3
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 269

Rep: Reputation: 54
Quote:
Originally Posted by AlucardZero View Post
1. plug it in
2. boot
3. check if it's automounted with "mount"
4. If not, mount it. It's probably /dev/sdX1 where X is a letter
5. use cp to copy files

It's probably that easy. If you run into problems then come back with details about exactly what you did and what errors you are receiving.
There is also a pretty good chance it will automount if you just plug the USB drive in with the server up. If not it is easy enough to mount with the mount command.
 
Old 06-02-2010, 11:26 PM   #4
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
If you use cp it will certainly move most of the content.
Is that what you mean to do or are you looking to use the external drive as a "clone" or other detailed backup copy.

Check out rsync and related scripts and GUI aids. In short,
the rsync utility says "Take the folder and file structure from HERE
and make an identical copy over THERE." The advantage comes from the fact that rsync only moves what doesn't already exist or what is different.

You can even use udev rules so that when you connect your external drive, a script runs, uses rsync, and brings your copy up-to-date. Just a thought.

~~~ 0;-Dan
 
Old 06-03-2010, 04:09 PM   #5
goldeneye075
LQ Newbie
 
Registered: Feb 2009
Posts: 18
Blog Entries: 2

Rep: Reputation: 0
I also have a same type of question:
I need to copy my data from the pc to an external hard drive with keeping the attributes;
so i used the command

cp -rp ~/sourceDir ~/Destination

but when i am coping it it give the error message
"cp: failde to preserve ownership for 'file' : Operation not permitted

and it copied the files to the destination but the attributes has changed from
-rw-r--r-- to
-rwxr-xr-x

I tried to copy it by loging as the root also but still the same thing happens. If possible please let me know how to copy the files with preserving the attributes

Thanks
 
Old 06-03-2010, 04:12 PM   #6
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 269

Rep: Reputation: 54
What is the file system on the destination drive? I don't think you will be able to preserve if it is going from ext3 to FAT for example.
 
Old 06-04-2010, 08:25 AM   #7
goldeneye075
LQ Newbie
 
Registered: Feb 2009
Posts: 18
Blog Entries: 2

Rep: Reputation: 0
/dev/sdb1 vfat

is it possible to partion the external hard drive to ext3 and to vfat?
 
Old 06-04-2010, 07:19 PM   #8
SaintDanBert
Senior Member
 
Registered: Jan 2009
Location: "North Shore" Louisiana USA
Distribution: Mint-20.1 with Cinnamon
Posts: 1,772
Blog Entries: 3

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by goldeneye075 View Post
...
i used the command

cp -rp ~/sourceDir ~/Destination

but when i am coping it it give the error message
"cp: failde to preserve ownership for 'file' : Operation not permitted
...
When making archival copies of files, it is usually best to do this under super-user (root) permissions. No only can root access almost everything without trouble, but it can certainly write-to almost everywhere as well.

Consider the following when trying to make a file copy for long term storage purposes:
Code:
user@host/path $ sudo cp --archive  sourceFiles  targerFolder/
The --archive option expands to include
  • --preserve=links ..... cause links to appear in the target
  • --preserve=mode ..... write original mode (permission) bits
  • --preserve=ownership ..... write original ownership data
  • --preserve=timestamp ..... write original time data
  • --no-dereference ..... copy link as a link not its contents
  • --recursive ..... open folders and process their contents

If you use --verbose, it will likely be slower when you watch it on your terminal STDOUT. Re-direct to a file and browse it later. You can check on progress with tail --lines=NN or tail --follow.

~~~ 0;-Dan
 
Old 06-06-2010, 02:37 PM   #9
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 269

Rep: Reputation: 54
Quote:
Originally Posted by goldeneye075 View Post
/dev/sdb1 vfat

is it possible to partion the external hard drive to ext3 and to vfat?
What do you mean ext3 and vfat? As far as the OS is concerned an external drive is just another block storage device, so it can be formatted and partitioned just as any other drive. Typically an external drive will have a single large partition, and a single parttion can only have one file system.

So yes, you can format the drive as ext3, NTFS, ext2, FAT32, etc. However you will need to choose only one FS (keep in mind if you change to ext3 the drive will not be readable in Windows) if you keep the default partition layout. Another option is to partition so that you can split the space between multiple FS types.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] changing GRUB from an external hard disk to the internal hard disk of my lap eco123 Linux - Newbie 2 05-15-2010 12:20 PM
Copy of IBM Server hard disk data to Another USB External Hard disk mazharcdn Linux - Server 2 09-02-2009 12:41 AM
External USB hard disk with Linux malcarada Linux - Newbie 6 04-05-2008 02:09 PM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM
possible to run linux from an external hard disk? hyderabadi Linux - Newbie 2 03-20-2003 05:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration