Moving 11.10 complete system to a new bigger Harddisk
Solution 1
Use clonezilla.
It will allow you to clone your current system including the mbr without actually copying unused space that dd does hence doing it faster
Since its reading / writing on a filesystem level you can only use it on a supported filesystem, on the contrary to dd, which works on a device level, allowing the copy of any filesystem.
Clonezilla's front page has a list of the software's limitations:
- The destination partition must be equal or larger than the source one.
- Differential/incremental backup is not implemented yet.
- Online imaging/cloning is not implemented yet. The partition to be imaged or cloned has to be unmounted.
- Software RAID/fake RAID/firmware RAID is not supported by default. It can be done manually only.
- Due to the image format limitation, the image cannot be explored or mounted. You can not recovery single file from the image. However, you still have workaround to make it, read this.
- Recovery Clonezilla live with multiple CDs or DVDs is not implemented yet. Now all the files have to be in one CD or DVD if you choose to create the recovery iso file.
Solution 2
I'd use Gparted.
- start from your Gparted LiveCD or LiveUSB (using Lily)
- Plug in both of your HD (old and new one)
- select partitions on the old disk and "COPY" it on the new disk
- Resize partitions on your new disk according to your willing
- Start from Ubuntu liveCD/liveUSB
Use blkid to check the UUID of the partitions on the new disk-
Edit your /etc/fstab located on your new disk according to your UUID -
Open a terminal (Ctrl + Alt + T) in order to re-install Grub on your new disk.
fdisk -l
fdisk to Check the name of the Ubuntu partition on your new disk. In my case, it's sda1 so let's continue by mounting this partition :
mount /dev/sda1 /mnt
Finally, let's re-install Grub in your new disk sda :
grub-install --boot-directory=/mnt /dev/sda
Shut down and re-start from your new disk !
[EDIT] Thanks to tomodachi, I edited my answer to reflect his advices :
No need to edit the fstab on the new HD because Gparted is supposed to copy the partition as well as its UUID
I added some extra steps to make your new HD bootable.
maybe there are simpler methods ?
Related videos on Youtube
Lukas Hamrla
Updated on September 18, 2022Comments
-
Lukas Hamrla over 1 year
I'm reading with my c++ program csv file:
abc;def;ghi 10;;10
by this code:
while(getline(in, str, '\n')){ stringstream ss; while(getline(ss, str, ';')){ line.add(str); } }
Where in is input file,
str
is string variable and line is my collection (likevector
). Butgetline
jumped over the empty string in csv file.Can anyone help me to reading empty string, too?
Thanks :)
-
pl1nk almost 12 years@James It's not a duplicate, in the question that you mentioned the OP doesn't want to re-install everything. I'm open to suggestions and prefer answers that depict advantages/disadvantages of any given approach.
-
artahian about 11 yearsHow do you know that it jumped? Anyway it will not enter second loop when the line is empty.
-
Lukas Hamrla about 11 yearsaram90: i have temp variable that counts numbers of reading and also in my list there is only 2 strings.
-
-
jasonwert almost 12 yearsWill Clonezilla bring over grub & the MBR also?
-
Samik almost 12 years@jasonwert here you can see how to include MBR and GRUB while disk copying, but while copying partition MBR won't be included as it's not a part of a partition.
-
tomodachi almost 12 years@jasonwert yes it will clone the mbr. I've added it to the response. Thanks for the feedback!
-
jasonwert almost 12 yearsThis worked great. I moved my root partition to an SSD two days ago using clonezilla. I used boot-repair from a live cd to setup grub. Thanks!
-
pl1nk almost 12 yearsIt works like a charm! Do you know how can I enlarge my partitions to use the available space --or should I make a new question?
-
Lukas Hamrla about 11 yearsI've initialized it before by this: ifstream in ( inFileName ); if (in.fail()) return false; It's ok. But compiler doesnt like your code :( error: no matching function for call to ‘std::basic_istringstream<char>::basic_istringstream(std::ifstream)'
-
Kerrek SB about 11 yearsYou seem to be doing something completely different. There is no
ifstream
in my code at all. Are you misspellingln
asin
? Let me rename the variables. -
Kerrek SB about 11 years@LukasHamrla: I find that hard to believe. The code does exactly what it should.
-
Serge Stroobandt over 7 yearsThe option
-t ext3
is outdated and can be left out. The option--root-directory=/mnt
should read--boot-directory=/mnt
, according toman grub-install
.