LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-11-2019, 04:46 PM   #1
webx99
Member
 
Registered: Feb 2019
Distribution: Centos 7
Posts: 103

Rep: Reputation: 11
switch boot disk from sda to another disk


Greetings

is there any fast way to switch from sda boot disk to another disk without loosing any data?

say from sda to sdc?

I don't use RAID currently.

Thank you.
 
Old 08-11-2019, 05:10 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
are you swapping your drives around and keeping the system on the same drive - just moving it to be your third disk? UUID in fstab, BIOS controlled to search all of your attached drives for a bootable system?

yes is the answer but, without knowing the particulars it is hard to tell you how.
 
Old 08-11-2019, 05:23 PM   #3
webx99
Member
 
Registered: Feb 2019
Distribution: Centos 7
Posts: 103

Original Poster
Rep: Reputation: 11
actually I have a problem with the boot disk sda and need to replace it, so I need a way to switch completely and safely to another disk and boot from there
 
Old 08-11-2019, 05:33 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
where is the operating system located? how damaged is the "boot" disk?

if you can access it, then having the os on sda, install grub on another disks mbr, update your grub, the set that drive as your boot drive in BIOS.

If this is a EFI boot, then that is going to be another situation, as I do not know EFI well enough other than theoretically.

theoretically, you should be able to set up another disk with your partitions needed and/or just the boot partition put the efi files in there then rework the efi grub to boot your OS on a different drive.


you might even be able to fix it. what happened to your drive to make it no longer bootable, other then total melt down.

Last edited by BW-userx; 08-11-2019 at 05:38 PM.
 
Old 08-11-2019, 06:16 PM   #5
webx99
Member
 
Registered: Feb 2019
Distribution: Centos 7
Posts: 103

Original Poster
Rep: Reputation: 11
os is located in sda, and I want to move to sdd (os and everything in the disk), both disks same type/model/size

the errors in the disks are:

---------------
Aug 10 22:41:54 dr kernel: [1455175.138946] ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Aug 10 22:41:54 dr kernel: [1455175.139311] ata1.00: failed command: FLUSH CACHE EXT
Aug 10 22:41:54 dr kernel: [1455175.139502] ata1.00: cmd ea/00:00:00:00:00/00:00:00:00:00/a0 tag 15
Aug 10 22:41:54 dr kernel: [1455175.140060] ata1.00: status: { DRDY }
Aug 10 22:41:54 dr kernel: [1455175.456591] ata1.00: supports DRM functions and may not be fully accessable.
Aug 10 22:41:54 dr kernel: [1455175.458181] ata1.00: supports DRM functions and may not be fully accessable.
Aug 10 22:41:54 dr kernel: [1455175.458291] ata1.00: configured for UDMA/133
---------------

I'm not sure how bad is the error?

Last edited by webx99; 08-11-2019 at 06:19 PM.
 
Old 08-11-2019, 06:17 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by BW-userx View Post
yes is the answer but, without knowing the particulars it is hard to tell you how.
Still applies. Getting those details seems to be like pulling teeth.

Edit: Finally getting somewhere. I tend to swap disks and chase the problem at my leisure. Copying to the other disk is relatively trivial - the easiest way to fix grub is to chroot into the second system once it is copied and do grub-install, update-grub.
After that pull the first disk out to save BIOS issues. For EFI the firmware should find the EFI partition ok.

Last edited by syg00; 08-11-2019 at 06:22 PM.
 
1 members found this post helpful.
Old 08-11-2019, 06:45 PM   #7
webx99
Member
 
Registered: Feb 2019
Distribution: Centos 7
Posts: 103

Original Poster
Rep: Reputation: 11
Thank you for the useful info.

Regards.
 
Old 08-11-2019, 06:58 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
I've never done/tried this before, Copying the entire OS onto another drive, but this link #19 shows a dd method on it.

https://askubuntu.com/questions/7417...-another-drive

then as stated, boot a live UBS stick Linux os, chroot and install your grub, update then reboot. you can also switch cables or how ever it is done on a desktop now days to make it sda again. before chroot.


As far as that error, I do not know, I'd put a line of it in the search bar then see what "google" comes up with.

Last edited by BW-userx; 08-11-2019 at 07:00 PM.
 
1 members found this post helpful.
Old 08-11-2019, 07:37 PM   #9
djk44883
Member
 
Registered: Aug 2008
Location: Ohio
Distribution: debian
Posts: 141

Rep: Reputation: 29
Quote:
Originally Posted by BW-userx View Post
I've never done/tried this before, Copying the entire OS onto another drive, but this link #19 shows a dd method on it.

Just to note, dd has NO confirmations, checks or are you sure - it's nickname DiskDestroyer is true. That said, it is powerful, handy and has purposes. A minor typo can render everything useless, this may not be the best case to try it out, your choice.


consider clonezilla, live boots from USB or old CDs. It's command line driven, so it's a bit advances, but plenty of guides, and I "think" it keeps things in tack for grub... maybe.


Not for disk, but partitions copying is possible with gparted live. The friendly GUI gparted you may already be comfortable with, copy and past from the menu.


But, yea, dd will get the job done, as with all these, the drive needs to be readable.
 
Old 08-11-2019, 11:34 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,141

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
I would go even further - dd is the last tool you should be considering. Especially if the disk - and maybe filesystem(s) - are suspect. I would suggest you (royal plural) limit your dd usage to forensic situations, or copying iso to USB key.

A filesystems aware tool like rsync or cp will tell you if it is unable to read the data due to filesystem corruption. Maybe gparted too, although I haven't used it for copying like that.
 
Old 08-12-2019, 07:01 AM   #11
djk44883
Member
 
Registered: Aug 2008
Location: Ohio
Distribution: debian
Posts: 141

Rep: Reputation: 29
As suggested, web search for your error message(they can be informative)
Code:
Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
some rarity issues suggest cables, even so, you may still have issues.
 
Old 08-12-2019, 07:07 AM   #12
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
alternatively, you could do a fresh install of your OS onto another drive, copy over your home, rsync, or cp, and get your customized config files as well.

I seen something on that error as MAYBE relaying to the kernel version, I did not look into it too far to completely verify that.

Before you go moving things around, I'd also suggest finding out what is causing that error on your hard drive, then see if there is a fix for it first.
 
Old 08-12-2019, 11:32 AM   #13
kilgoretrout
Senior Member
 
Registered: Oct 2003
Posts: 2,988

Rep: Reputation: 388Reputation: 388Reputation: 388Reputation: 388
Quote:
os is located in sda, and I want to move to sdd (os and everything in the disk), both disks same type/model/size
Given the above, the easiest way is to clone sda to sdd using clonezilla:

https://clonezilla.org/clonezilla-live.php

It's faster than using straight dd for cloning and it will clone your bootloader, grub, to sdd in the process. Then you just need to shift your boot drive to sdd in your bios. Also, clonezilla will more gracefully deal with possible hard drive read issues from sda.

I also agree with djk44883's comments about checking your cabling to sda. Try swapping out the data cable if you have an extra one handy and also try using another power cable to the drive.
 
  


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] using switch in a function to call another function with a switch but it is not going into 2 switch ... BW-userx Programming 2 08-20-2017 11:47 PM
[SOLVED] POE Switch powering another switch ? fritz001 Linux - Hardware 3 07-08-2014 12:35 PM
[SOLVED] sda drive to sdb, so new hdd can become sda? irgunII Slackware 5 03-07-2014 08:38 AM
Volumes switch from sda's to mpath's after reboot anon091 Linux - Server 8 01-16-2013 12:58 PM
mount USB devices, sda, manually/statically assign sda? Oxyacetylene Debian 3 12-20-2004 02:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:33 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