Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to change out a drive

  1. #1
    Join Date
    Dec 2008
    Location
    Montana, USA
    Posts
    676

    Default How to change out a drive

    My current system:

    Dual boot openSuse 13.1 and openSuse 12.3

    sda SSD
    sda1 300 MB - FAT - no label - mounted as /boot/efi
    sda2 55 GB - ext4 - suse131-root - mounted as /
    sda3 55 GB - ext4 - suse123-root - not mounted now

    sdb mechanical
    sdb1 31 GB - swap - swap - mounted as swap
    sbd2 31 GB - ext4 - suse131-tmp - mounted as /tmp
    sdb3 31 GB - ext4 - suse131-var - mounted as /var
    sbd4 850 GB - ext4 - suse131-home - mounted as /home
    sbd5 32 GB - ext4 - suse123-tmp -
    sbd6 32 GB - ext4 - suse123-var -
    sbd7 855 GB - ext4 - suse123-home -

    fstab is using /dev/disk/by-path/pci-0000:00:11.0-scsi-X:0:0:0:0-partX. I would be careful to create the first 4 matching partitions in the same order.

    Reason for my thread: sdb4 has come up with 2 corrupted files. I no longer trust it.

    What I want to do: (obviously) replace sdb with a new drive.

    Specifics: sdb is currently a Seagate Barracuda 2 TB drive, relatively new, but as I said showing file corruption. I have purchased a Western Digital VelociRaptor 1 TB drive which is rated as a continuous duty, 10,000 rpm long life drive.

    Related information: I no longer need the copy of openSuse 12.3 and not interested in preserving it during this operation.

    My question: Can (should) I use dd to copy the files from the wanted partitions on the old drive to the matching partitions on the new drive? What if the partitions on the new drive end up slightly smaller than the partitions on the old drive? The man page for dd is... ah.... complex. I'm concerned about making a wrong choice.

    or

    Should I boot a live copy, mount the two drives, partition the new one, and simply copy the contents from the old to the new?

    When I'm done, I intend to simply delete the files in sda3, and run grub2-install to correct the boot menu.

    Opinion solicited: Is there a better way to set up my system to allow this sort of change to be made?

    I know I could, and maybe should, just try different ways to do this. I might even learn something. But, with 140 GB of "stuff" on my system, hours and hours of configuration to get things just the way I want, the desire to have my system up and running, and 55 to 60 hours a week devoted to my job, I'm taking the quick way out and asking for help.

    Bart

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,320
    Blog Entries
    15

    Default Re: How to change out a drive

    Hi
    How much system RAM? I use 8GB with an ssd and have yet to use swap......

    If it were me, I would use the 1TB drive as a /data type gpt partition, then delete sda3 and expand sda2 to use it all including a /home

    I wouldn't even worry about /tmp etc it doesn't write that much. This is a busy machine and on average I write 6.5GB of data to the ssd per day and it's rated at 20GB per day and a 5 year warranty.

    Wipe the old 2TB drive and use that for a backup device....

    I recommend the openSUSE 13.1 rescue cd to boot from and use gparted to prepare/modify the partitions.

    io scheduling with the two drives probably needs to be investigated as well.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to change out a drive

    On 2014-03-29 02:46, montana suse user wrote:

    > Reason for my thread: sdb4 has come up with 2 corrupted files. I no
    > longer trust it.


    What say SMART? Did you run the long test?



    > Should I boot a live copy, mount the two drives, partition the new one,
    > and simply copy the contents from the old to the new?


    As the partitions of that disk are data only, I would do a file by copy,
    yes.

    I did this recently. I use rsync with checksum verification, using the
    normal system at the same time I use it. Twice (the second run is for
    verification).

    Code:
    
    > PARAMETROS="--archive --sparse --one-file-system --acls --xattrs --hard-links --stats --human-readable --checksum"
    > time rsync $PARAMETROS  /SOURCE/DIR_1/ /DEST/MGR/DIR_1
    Then I boot the live system, and run rsync a third time, but this time
    without checksum, and with --del.

    Code:
    
    > PARAMETROS="--archive --sparse --one-file-system --acls --xattrs --hard-links --stats --human-readable --del"
    > time rsync $PARAMETROS  /SOURCE/DIR_1/ /DEST/MGR/DIR_1
    This third time is to copy only the last files that changed while I was
    usint the computer and doing the main copy. Without checksum it runs
    fast, and deletes the files that were deleted on the source.

    Be careful with "--del", if you mistake the paths it can delete
    everything on the target.


    > When I'm done, I intend to simply delete the files in sda3, and run
    > grub2-install to correct the boot menu.


    There are no changes to grub, I understand. Only sda is affected.

    You only need mkinitrd, after changing fstab.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  4. #4
    Join Date
    Dec 2008
    Location
    Montana, USA
    Posts
    676

    Default Re: How to change out a drive

    Quote Originally Posted by malcolmlewis View Post
    Hi
    How much system RAM? I use 8GB with an ssd and have yet to use swap......
    32GB Why so much? I just don't like empty slots. They get full of dust!
    So I can just not create / use a swap partition?

    If it were me, I would use the 1TB drive as a /data type gpt partition, then delete sda3 and expand sda2 to use it all including a /home
    You say "a home". From /home/bart on this machine, I have 140 GB of data. My home wouldn't fit on the SSD.
    Then again, I "may" want to add another OS in the future. I can add another mechanical drive and use sad3 for it. I'm curious about Magia (sp?)

    I wouldn't even worry about /tmp etc it doesn't write that much. This is a busy machine and on average I write 6.5GB of data to the ssd per day and it's rated at 20GB per day and a 5 year warranty.
    That's kind of what I thought. I just set it up on the mechanical drive because I had plenty of room and just tried to limit, as much as possible, writing to the SSD. It gets enough with the security fixes and all.

    Wipe the old 2TB drive and use that for a backup device....
    I may just put it in an old machine and stress test it. It may just be a one time thing, it may have been something else that corrupted that file, it may be a bad drive. If it turns out a good drive, I'll give it away. I no longer feel comfortable with it around even if tests prove it good. Just one of my "things" I guess.

    I recommend the openSUSE 13.1 rescue cd to boot from and use gparted to prepare/modify the partitions.
    I'll follow those recommendations!

    io scheduling with the two drives probably needs to be investigated as well.
    ???????

    Thanks for your time!

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to change out a drive

    On 2014-03-29 03:06, malcolmlewis wrote:
    > Hi
    > How much system RAM? I use 8GB with an ssd and have yet to use
    > swap......


    Code:
    
    > cer@Telcontar:~> free -h
    >              total       used       free     shared    buffers     cached
    > Mem:          7,8G       7,6G       243M       116M        73M       5,4G
    > -/+ buffers/cache:       2,1G       5,7G
    > Swap:          20G       2,1G        18G
    > cer@Telcontar:~>
    As you see, I have 8 GiB and I do use swap.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  6. #6
    Join Date
    Dec 2008
    Location
    Montana, USA
    Posts
    676

    Default Re: How to change out a drive

    Quote Originally Posted by robin_listas View Post
    On 2014-03-29 02:46, montana suse user wrote:

    > Reason for my thread: sdb4 has come up with 2 corrupted files. I no
    > longer trust it.


    What say SMART? Did you run the long test?



    > Should I boot a live copy, mount the two drives, partition the new one,
    > and simply copy the contents from the old to the new?


    As the partitions of that disk are data only, I would do a file by copy,
    yes.

    I did this recently. I use rsync with checksum verification, using the
    normal system at the same time I use it. Twice (the second run is for
    verification).

    Code:
    
    > PARAMETROS="--archive --sparse --one-file-system --acls --xattrs --hard-links --stats --human-readable --checksum"
    > time rsync $PARAMETROS  /SOURCE/DIR_1/ /DEST/MGR/DIR_1
    Then I boot the live system, and run rsync a third time, but this time
    without checksum, and with --del.

    Code:
    
    > PARAMETROS="--archive --sparse --one-file-system --acls --xattrs --hard-links --stats --human-readable --del"
    > time rsync $PARAMETROS  /SOURCE/DIR_1/ /DEST/MGR/DIR_1
    This third time is to copy only the last files that changed while I was
    usint the computer and doing the main copy. Without checksum it runs
    fast, and deletes the files that were deleted on the source.

    Be careful with "--del", if you mistake the paths it can delete
    everything on the target.


    > When I'm done, I intend to simply delete the files in sda3, and run
    > grub2-install to correct the boot menu.


    There are no changes to grub, I understand. Only sda is affected.

    You only need mkinitrd, after changing fstab.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

    Now, That is an elegant and secure way of doing it! Regarding the paths, would your example /SOURCE/DIR_1/ be
    "/home" (which is the partition mount point) or "sdb4" which is the partition?

    When this is all done, the old drive removed and the new one in, the drive should match the entries in fstab. That is, the partitions will be created on the new drive in the same order as the old drive and so should be recognized as not changed. At least that was my intention when creating fstab. The grub2-install was to eliminate the openSuse 12.3 choice in the boot menu.

  7. #7
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    32,320
    Blog Entries
    15

    Default Re: How to change out a drive

    Quote Originally Posted by montana_suse_user View Post
    32GB Why so much? I just don't like empty slots. They get full of dust!
    So I can just not create / use a swap partition?



    You say "a home". From /home/bart on this machine, I have 140 GB of data. My home wouldn't fit on the SSD.
    Then again, I "may" want to add another OS in the future. I can add another mechanical drive and use sad3 for it. I'm curious about Magia (sp?)
    Hi
    My /home hardly gets used, for example multimedia, videos etc are on /data with softlinks to Music Videos Pictures etc Most of my files sit on a flle server (1TB RAID 10 setup), just stuff I use in common go on /data it helps if your wanting to multiboot so you can share common files.

    On the file server empty slots have covers on the ram, pci and pci-e slots

    Because you have an SSD and a rotating drive you can setup the i/o scheduling on the individual devices since I have just an SSD the elevator is set to noop.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  8. #8
    Join Date
    Dec 2008
    Location
    Montana, USA
    Posts
    676

    Default Re: How to change out a drive

    Quote Originally Posted by robin_listas View Post
    On 2014-03-29 02:46, montana suse user wrote:

    > Reason for my thread: sdb4 has come up with 2 corrupted files. I no
    > longer trust it.


    What say SMART? Did you run the long test?
    Short test says no errors. Didn't run long test. Perhaps I will after the change. I can just plug this drive in and run the test on the drive assigned without mounting it, right?

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: How to change out a drive

    On 2014-03-29 03:56, montana suse user wrote:

    > Now, That is an elegant and secure way of doing it! Regarding the
    > paths, would your example /SOURCE/DIR_1/ be
    > "/home" (which is the partition mount point) or "sdb4" which is the
    > partition?


    The mount point.


    > When this is all done, the old drive removed and the new one in, the
    > drive should match the entries in fstab. That is, the partitions will
    > be created on the new drive in the same order as the old drive and so
    > should be recognized as not changed. At least that was my intention
    > when creating fstab.


    Well, in my case, it does not matter at all, because I mount using labels.

    Correction: it does not matter in any case, as long as you create the
    correct entries in fstab. The system does not see partitions, it sees
    mounted filesystems. It does not matter where they are on the disk, or
    disks.

    As a matter of fact, my destination drive has more partitions, and I
    split some of my source paths over different destination partitions.

    > The grub2-install was to eliminate the openSuse
    > 12.3 choice in the boot menu.


    Ah, well... I split dangerous operations. First one, check, then the
    other. ;-)

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  10. #10
    Join Date
    Dec 2008
    Location
    Montana, USA
    Posts
    676

    Default Re: How to change out a drive

    Quote Originally Posted by robin_listas View Post
    On 2014-03-29 03:56, montana suse user wrote:

    > Now, That is an elegant and secure way of doing it! Regarding the
    > paths, would your example /SOURCE/DIR_1/ be
    > "/home" (which is the partition mount point) or "sdb4" which is the
    > partition?


    The mount point.
    Then I would mount the new drive partition and use that point as the destination?

    > When this is all done, the old drive removed and the new one in, the
    > drive should match the entries in fstab. That is, the partitions will
    > be created on the new drive in the same order as the old drive and so
    > should be recognized as not changed. At least that was my intention
    > when creating fstab.

    Well, in my case, it does not matter at all, because I mount using labels.

    Correction: it does not matter in any case, as long as you create the
    correct entries in fstab. The system does not see partitions, it sees
    mounted filesystems. It does not matter where they are on the disk, or
    disks.

    As a matter of fact, my destination drive has more partitions, and I
    split some of my source paths over different destination partitions.


    Would you post a sample line from your fstab? I would like to use labels as I think it would be easier for changes and even clearer as to what is what.

    > The grub2-install was to eliminate the openSuse
    > 12.3 choice in the boot menu.

    Ah, well... I split dangerous operations. First one, check, then the
    other. ;-)
    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

    Ah yes! Although I didn't say so, that is what I had in mind.

    Bart

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •