LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Hardware (http://www.linuxquestions.org/questions/forumdisplay.php?f=18)
-   -   Change the drive my system is on from usb to sata (http://www.linuxquestions.org/questions/showthread.php?t=4175433392)

skinney 10-21-2012 04:46 PM

Change the drive my system is on from usb to sata
 
i have an old pc i'm running ubuntu server 12 on
it has two sata slots and i'm using both to run two 2TB drives and my sys is installed on a 8GB flash drive. i've learned that flash drives don't handle lots of writes and will fail eventually. i'm going to move my system to a 350 laptop HDD i have in a usb enclosure. i'll just run it from usb and maybe in the future i'll spring for a pci sata card to add a few more sata ports.
If I have my system installed on a drive connected via usb and then switch it to an sata connection will it work? will it boot?
It probably isn’t even necessary but I’m curious about my options down the road after I move my system to this USB HDD

qlue 10-22-2012 04:01 AM

The simple answer is yes. However, you have to transfer the system the right way and there are a few issues that can complicate things.
For one thing, you will have to other use a different pc or boot from a different disk in order to copy the system.
I normally use this line to transfer the system. (note this overwrites the destination drive completely)
Code:

dd if=/dev/sdb of=/dev/sdc bs=1M
/dev/sdb and /dev/sdc are as examples only and you must make certain of the correct drives. in this example, /dev/sdc is the destination drive.
After that finishes, and it could take some time, I use gparted to expand partitions as needed.
But be very careful with dd as it will wipe out anything on the destination drive you specify, even if it's the wrong drive.

jefro 10-22-2012 04:59 PM

Many distro's have enough support in them but a combination of bios and OS and boot device may need to be checked. Also when you move stuff around, some device names may need to be changed in both grub and fstab and maybe other places. Might make them generic before moving.

Clonezilla or redobackup or as above dd may work fine.

Using a cf disk isn't bad as long as you limit writes. Normal embedded system are fine for constant reads.

Might be easy to just load the new OS to the hard drive from original media.

skinney 10-23-2012 10:39 AM

Quote:

Originally Posted by qlue (Post 4811974)
I normally use this line to transfer the system. (note this overwrites the destination drive completely)
Code:

dd if=/dev/sdb of=/dev/sdc bs=1M

do you need to reinstall grub to make it bootable or doesn't dd do it all?

skinney 10-23-2012 10:43 AM

Quote:

Originally Posted by jefro (Post 4812533)

Using a cf disk isn't bad as long as you limit writes. Normal embedded system are fine for constant reads.

can you explain this a little more? i'm new to linux

Quote:

Originally Posted by jefro (Post 4812533)
Might be easy to just load the new OS to the hard drive from original media.

do you mean do a fresh os install? can i do that and keep all my lvm info for my two existing harddrives?

skinney 10-23-2012 01:24 PM

Quote:

Originally Posted by qlue (Post 4811974)
Code:

dd if=/dev/sdb of=/dev/sdc bs=1M

wow, it's that easy. no grub reinstall or nothing.

thx!

wait, i cant resize my pv or lv. it still thinks it's on an 8GB drive


All times are GMT -5. The time now is 05:22 PM.