LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 05-04-2011, 12:45 PM   #1
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Rep: Reputation: 0
How to copy/clone a disk on T2000 with Solaris 10


Hi, on my T2000, there are currently two disks, no RAID. OS is installed on c0t0d0.

On c0t1d0, there is only one partition, and this disk is mounted under /zones.

Given that I never done this before, could someone offer step by step guide to copy c0t1d0 to c0t3d0?

c0t3d0 is a brand new disk of the same capacity. Thanks.

Last edited by Ben99; 05-04-2011 at 12:47 PM.
 
Old 05-04-2011, 12:51 PM   #2
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 116Reputation: 116
Not necessarily the most efficient but certainly one of the most effective ways:

% dd if=/dev/rdsk/c0t1d0s2 of=/dev/rdsk/c0t3d0s2 bs=128

(Bearing in mind that slice 2 is actually a representation of the whole disk - stupid but true).
 
Old 05-04-2011, 01:23 PM   #3
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Original Poster
Rep: Reputation: 0
do you need to shutdown OS to do this?
what about other slices?
 
Old 05-04-2011, 01:39 PM   #4
zordrak
Member
 
Registered: Feb 2008
Distribution: Slackware
Posts: 595

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by Ben99 View Post
do you need to shutdown OS to do this?
No, 'cos it's not your OS disk.

Quote:
Originally Posted by Ben99 View Post
what about other slices?
That's what I meant about the representation of the whole disk.

Slice 2 isn't a real partition, it's how you access the whole raw disk. Saying c0t1d0s2 is just like saying c0t1d0, but tools won't work on the disk as a whole without a slice numbers, so Solaris works by using slice 2 to mean "the whole disk". That's why slice 2 is always the same size as the disk itself.
 
Old 05-04-2011, 01:42 PM   #5
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Original Poster
Rep: Reputation: 0
zordrak:

Thank you much. I will post the results after I execute that command.
 
Old 05-04-2011, 02:24 PM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by zordrak View Post
Not necessarily the most efficient but certainly one of the most effective ways:

% dd if=/dev/rdsk/c0t1d0s2 of=/dev/rdsk/c0t3d0s2 bs=128
That would be extremely slow. I would recommend something like bs=128k if you don't wan't the copy to take hours, if not days.
Quote:
(Bearing in mind that slice 2 is actually a representation of the whole disk - stupid but true).
That's an historical convention from the Solaris BSD legacy. Note that this doesn't apply on x86 architecture, but it's okay with a T2000 (SPARC).
 
Old 05-04-2011, 02:29 PM   #7
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Ben99 View Post
do you need to shutdown OS to do this?
No, but I would strongly advise to unmount all filesystems using the source disk.

Depending on how much of the disk space is used by actual data, an ufsdump/ufsrestore might be more efficient.

If you use ZFS and not UFS, the dd cloning method might fail.
 
Old 05-04-2011, 02:29 PM   #8
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Original Poster
Rep: Reputation: 0
here is what I got:

# dd if=/dev/rdsk/c0t1d0s2 of=/dev/rdsk/c0t3d0s2 bs=128
read: Invalid argument
0+0 records in
0+0 records out


any suggestions?
 
Old 05-04-2011, 03:48 PM   #9
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Code:
dd if=/dev/dsk/c0t1d0s2 of=/dev/dsk/c0t3d0s2 bs=128k
 
Old 05-05-2011, 12:14 AM   #10
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Original Poster
Rep: Reputation: 0
it took long time, then it failed.

Is it better to unmount the if and of target, then run the dd command?
 
Old 05-05-2011, 04:11 AM   #11
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Ben99 View Post
it took long time
How long ? What is the disk size ?
Quote:
then it failed.
What makes you feel it did ?
Quote:
Is it better to unmount the if and of target, then run the dd command?
I already wrote you need to unmount the source filesystems. Unmounting the target doesn't make sense as it can't be mounted yet anyway.
 
Old 05-05-2011, 09:05 AM   #12
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Original Poster
Rep: Reputation: 0
jlliagre,

Thanks for taking time to answer the questions. I am not that familiar with Solaris, but this T2000 was thrown to me

How can I tell if I have ZFS?

Given that I did not umount source disk, and some data has been written to target disk.
Can I format the target and start over?

The source disk contains just three zones.
 
Old 05-05-2011, 09:16 AM   #13
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Ben99 View Post
How can I tell if I have ZFS?
By running
Code:
zpool list
zpool status
Quote:
Given that I did not umount source disk, and some data has been written to target disk.
Can I format the target and start over?
There is no need to format the target disk in the first place.
Just turn off these three zones, unmount their filesystems and start over.

What is your disk size ?
How long did the first dd take ?
What makes you feel it failed ?
 
Old 05-05-2011, 09:38 AM   #14
Ben99
LQ Newbie
 
Registered: Apr 2011
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
What is your disk size ?
the disk size is 72GB

Quote:
How long did the first dd take ?
about 4 hours

Quote:
What makes you feel it failed ?
The console displayed various warnings and errors. I did not capture

Last edited by Ben99; 05-05-2011 at 09:42 AM.
 
Old 05-05-2011, 10:47 AM   #15
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Quote:
Originally Posted by Ben99 View Post
The console displayed various warnings and errors. I did not capture
Please keep and post them when you try again.
 
  


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
Clone or copy schafferm Linux - General 1 09-05-2010 05:41 PM
clone hard disk with: cat /dev/sda >/media/disk/backup deathalele Linux - Security 3 04-17-2009 12:29 AM
RAID1 array down to one disk with bad blocks, clone to good disk with dd noerror? ewolf Linux - Server 2 05-10-2008 12:40 AM
K3B Disk Copy types: Normal vs. Clone? Bob P Linux - Software 3 10-15-2004 05:40 PM
CLone/Copy a partition Tyir Linux - General 12 01-28-2004 09:02 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 09:04 PM.

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