I
I
Intelide2016-10-02 10:33:46
linux
Intelide, 2016-10-02 10:33:46

How to move the system to another larger disk?

Good afternoon.
There are 2 disks, it is necessary to transfer the system from one to another, but one to which I transfer a little by sectors more somewhere by 1-2GB
dd if=/dev/sda of=/dev/sdb bs=8M conv=sync,noerror
If I transfer it like that, will everything work later?
do you need to take any additional steps?
thanks in advance

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Melkij, 2016-10-02
@melkij

Will work. You don't even need to edit fstab.
Additional steps will be needed if you want to somehow use the free space from a larger disk.

X
xotkot, 2016-10-02
@xotkot

dd clones the disk one to one, so there should be no problems,
the only thing is that it may still be necessary to tweak fstab:
- if you use partition identification by UUID, then it will change
- or if identification by name is used (/dev/sd{a, b,c...}) and you add another drive, then sda and sdb can swap places
anyway, the system simply won't boot
when you make sure that everything boots up and works fine, you can expand the partition table and use the free space by adding it to the adjacent partition (done with live-cd / usb):

# parted /dev/sda resizepart 2 100%
# e2fsck -f /dev/sda2
# resize2fs /dev/sda2

here sda2 (resizepart 2) is the extreme section that adjoins the free space and which we expand, of course we put our
ps .
everything described is true for traditional file systems

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question