LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-17-2016, 07:20 AM   #1
johnniedoo
Member
 
Registered: Jun 2014
Location: USA
Distribution: MINT17.3 Mate, Cinnamon , Mint MATE 18.1
Posts: 73

Rep: Reputation: Disabled
Migrate Mint 17.3 from HDD partition to SSD


I have my Mint 17.3 Mate installed on 440Gb of a 1Tb WD 7200 rpm HDD. other half is storage from windows things eg Movie/vids. I have a 128gb crucial M4 that i had windows 7 on in another computer that i had used for a couple of yrs, I bought a new 250Gb samsung 850 EVO and just migrated the smaller to the new one.
I now put that crucial M4 128gb into the box with the WD 2 partition drive with the Mint on it.
I want to migrate that Mint from its 440gb partition onto the old ssd with the windows 7 x64 still on it.
I do not know if it is possible as is. the partition is 4x the size of the target 128 ssd.even though the size of the whole Mint is just about 55gb. I used gparted to get it to where it is, but did not make multiple partitions , just the swap and other ntfs side, the Linux side being ext4 .
I am wondering how to go about moving the thing intact so i do not have to completely rebuild what i have already.
i have tried to use clonezilla already but have failed each try for various reasons. mostly because i am pretty new to all this
only used gparted the one or two times i needed to create the few versions of mint i have. each time it was not a smooth process-needed to try a few times to get it sort of right.
I am wondering if i should use gparted to shrink down the HDD partition where Linux mint is first.
and if i should format the target ssd to ext4 prior to making any migration/clone attempts?
i know there is the option to just do a clean install onto the ssd, but i am not aat all comfortable with then trying to send my older system settings and such afterward
the windows 7 ssd to ssd migration was so smooth and only took a few minutes to accomplish i thought i might be able to do something similar and forgot about that huge hdd total partition size vs the 128gb ssd. i though only of the size of the system even including swap size being 55gb.
if someone could just point me in a direction, i think i may be able to persevere . i am just worried i will wipe out the system that is on the hdd in my trial and error methods
i have not found anything close to being helpful for my situation though i have searched and tried a dozen different methods from youtube, clonezilla and elsewhere.
thanks
john
 
Old 02-17-2016, 07:44 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Clonezilla won't work if (as appears to be your case) the target partition is smaller than the source. rsync from a liveCD/USB is usually the best answer.
Then you need to clean up - normally just fixing UUIDs in fstab, and re-installing grub.
Let's see the output from this for the machine with the 1 TB WD and 128 Gig SSD
Code:
lsblk -f -o +size
sudo parted /dev/sda "print free"
sudo parted /dev/sdb "print free"
cat /etc/fstab

Last edited by syg00; 02-17-2016 at 07:45 AM.
 
1 members found this post helpful.
Old 02-18-2016, 11:38 AM   #3
johnniedoo
Member
 
Registered: Jun 2014
Location: USA
Distribution: MINT17.3 Mate, Cinnamon , Mint MATE 18.1
Posts: 73

Original Poster
Rep: Reputation: Disabled
thanks for getting back so fast
I could not get the anything for the first line :

Code:
haf912@haf912 ~ $ lsblk -f -o +sizehaf912@haf912 ~ $ lsblk -f -o +size
lsblk: unknown column: +size
haf912@haf912 ~ $ lsblk -f -o +size
lsblk: unknown column: +size
haf912@haf912 ~ $ sudo parted /dev/sda "print free"
sudo: unable to resolve host haf912
[sudo] password for haf912: 
Model: ATA SAMSUNG HD103SJ (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system     Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  488GB   488GB   primary  ntfs
 2      488GB   989GB   501GB   primary  ext4            boot
        989GB   989GB   429kB            Free Space
 3      989GB   1000GB  11.3GB  primary  linux-swap(v1)
        1000GB  1000GB  745kB            Free Space

haf912@haf912 ~ $ sudo parted /dev/sdb "print free"
sudo: unable to resolve host haf912
Model: ATA M4-CT128M4SSD2 (scsi)
Disk /dev/sdb: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        32.3kB  1049kB  1016kB           Free Space
 1      1049kB  106MB   105MB   primary  ntfs         boot
 2      106MB   128GB   128GB   primary  ntfs
        128GB   128GB   1368kB           Free Space

haf912@haf912 ~ $ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda2 during installation
UUID=44dd054b-1e33-4db9-a413-520acb0f04c5 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda3 during installation
UUID=60182cbd-4a5f-4d38-920c-4b889ee0264f none            swap    sw              0       0
haf912@haf912 ~ $
I hope i did this properly. never had to upload so much code
JOhn
 
Old 02-18-2016, 02:28 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Try it as
Code:
lsblk -f
 
Old 02-19-2016, 03:30 PM   #5
johnniedoo
Member
 
Registered: Jun 2014
Location: USA
Distribution: MINT17.3 Mate, Cinnamon , Mint MATE 18.1
Posts: 73

Original Poster
Rep: Reputation: Disabled
Code:
haf912@haf912 ~ $ lsblk -f
NAME   FSTYPE LABEL MOUNTPOINT
sda                 
├─sda1              /media/haf912/SAMSUNG 1T
├─sda2              /
└─sda3              [SWAP]
sdb                 
├─sdb1              
└─sdb2              /media/haf912/5CE4D00DE4CFE77C
sdc                 
└─sdc1              /media/haf912/UUI
sr0                 
haf912@haf912 ~ $
ok thanks, I am so much of a novice I couldnt figure that out by myself yet
appreciate it
I did try to use the mint 17.1 live usb I made to do gparted and shrink down the partition on my hdd from 440gb (approx) to just more than the size of the system. but chickened out since I didnt know if i should move swap partition or whether to leave the shrunken part in place with the unallocated piece between it and swap. too many variables that might interfere with being able to re boot at all. I have already made a ton of mistakes that messed up the next reboot on my first linux mint experiments on other machines before i built this one
I wanted to be able to totally separate it from the hdd and be only linux on its own drive-ssd- and open up the old hdd for movie and old radio mp3 storage ,things like that.
 
Old 02-19-2016, 09:08 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
You should be ok if you want to do the shrink with gparted and Clonezilla. Personally I wouldn't make it too small as gparted needs some work space to shuffle things around - maybe 80 or 90 Gig. gparted is pretty (make that extremely) good.
Delete the stuff on the SSD and make an ext4 partition on it of whatever size - even the entire thing is good.

Leave the swap where it is - it's at the end of the disk, out of the way.
You will have to fix the new /etc/fstab as the new ext4 partition on the SSD will have a different UUID. That lsblk should have shown UUIDs as well - what system did you run that command from ?. "sudo blkid" will show the UUIDs.
You will also need to update the boot-loader - here is a tute that should help.

Last edited by syg00; 02-19-2016 at 09:09 PM. Reason: blkid
 
1 members found this post helpful.
Old 02-20-2016, 12:08 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,147

Rep: Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124Reputation: 4124
Thinking more on this, I'm not sure what Clonzilla will do with the UUID of the target partition (on the SSD). You may well finish up with both partitions with the same UUID. That will be a problem.
You won't have to fix fstab in that case, but you will have to force the UUID on the original partition to something else - try "tune2fs -U random /dev/sda2". See "man tune2fs" - even for ext4.
 
2 members found this post helpful.
Old 02-21-2016, 10:46 AM   #8
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by syg00 View Post
Clonezilla won't work if (as appears to be your case) the target partition is smaller than the source. rsync from a liveCD/USB is usually the best answer.
I agree. rsync is the way to go.

Quote:
Originally Posted by syg00 View Post
Then you need to clean up - normally just fixing UUIDs in fstab, and re-installing grub.
In addition to editing fstab and re-installing Grub, you probably have to refresh the initfs.
Code:
 update-initramfs -u
That would be done using the chroot process - https://help.ubuntu.com/community/Gr...ing#via_ChRoot

Quote:
Originally Posted by syg00 View Post
Code:
lsblk -f -o +size
The correct command would be:
Code:
sudo lsblk -o NAME,SIZE,FSTYPE,UUID,MOUNTPOINT,LABEL

Last edited by TxLonghorn; 02-21-2016 at 10:52 AM.
 
1 members found this post helpful.
Old 02-21-2016, 11:28 AM   #9
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Boot the live DVD or USB.
Open a terminal.
Mount both partitions.
EXAMPLE:
Code:
udisks --mount /dev/sda1
Then rsync:
Code:
sudo rsync -avz /media/mountpoint1 /media/mountpoint2
Be sure to change "mountpoint1" and "mountpoint2" to the correct names.
Chroot to the new partition:
Code:
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /media/mountpoint2$i; done
Be sure to change "mountpoint2" to the correct name.
Code:
 sudo chroot /media/mountpoint2
Refresh the initfs:
Code:
update-initramfs -u
Install Grub to the approprate drive - sdc? sdb?
Code:
grub-install --recheck /dev/sdc
Code:
update-grub
Open /etc/fstab in your text editor: (mine is gedit)
Code:
gedit /etc/fstab
Enter the new UUID number for your new / partition. Save and exit.
CTRL-D to exit chroot
CTRL-D to exit the terminal

Last edited by TxLonghorn; 02-21-2016 at 11:37 AM.
 
1 members found this post helpful.
Old 02-28-2016, 05:52 AM   #10
johnniedoo
Member
 
Registered: Jun 2014
Location: USA
Distribution: MINT17.3 Mate, Cinnamon , Mint MATE 18.1
Posts: 73

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Thinking more on this, I'm not sure what Clonzilla will do with the UUID of the target partition (on the SSD). You may well finish up with both partitions with the same UUID. That will be a problem.
You won't have to fix fstab in that case, but you will have to force the UUID on the original partition to something else - try "tune2fs -U random /dev/sda2". See "man tune2fs" - even for ext4.
Thanks for all the thought and assistance you've put in here. I actually understand 75% of everything you showed me here
I was wondering about that UUID stuff and how i have this particular computer set up or what happened when i added the SSD from the last computer build i had used as the "C" drive in the windows7 part-i have linux mint on an eSATA external drive there with a dual boot set up, but had EasyBCD 2.2 in there somewhere from long ago. so there was boot loaders all over the place. it worked just fine where it was.
I took it out of that box and just slid it into my new build which was Linux only. Clonezilla had a boot folder put onto the 128Gb SSd with win7 on it. i didnt ever bother to try to boot into it but right after i fiddled around with the aborted clonezilla try to copy or clone , I noticed that there is now always a grub boot menu for dual booting. i forget if it got Easy BCD into the mix or not, since it probably was in the old win7 system i left on the ssd. i did that just in case i needed something off it after the migration I didnt notice right away after the proper windows7 migration from this 128gb ssd to the new Samsung850 evo 250Gb. it was perfectly executed by a good freeware program. but i didnt want to just purge the OS from the 128SSD -but it has been a few weeks now and i am fine with replacing it . besides i made an image inside mint with the disk app and saved it.
I am just getting back to the 'project' family birthdays and issues have me putting all my computers on hold.
thanks again. will be getting back in a few days on this. just did a dry run with gParted and appreciate these posts will need to read/re read them,though i will have them all up in my other display in another computer here. one benefit from saving parts and making back up computers.
i do not use smart phones or other devices, only my linux resuscitated old x64 2core laptop from 2008 had vista on it and refused to run. it now does all sorts of things. got me interested in Linux-Mint about 18 months ago. so i am fairly new with this but help such as this keeps me learning and advocating the platform to everyone i see, just about
john
 
Old 02-28-2016, 06:01 AM   #11
johnniedoo
Member
 
Registered: Jun 2014
Location: USA
Distribution: MINT17.3 Mate, Cinnamon , Mint MATE 18.1
Posts: 73

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TxLonghorn View Post
Boot the live DVD or USB.
Open a terminal.
Mount both partitions.
EXAMPLE:
Code:
udisks --mount /dev/sda1
Then rsync:
Code:
sudo rsync -avz /media/mountpoint1 /media/mountpoint2
Be sure to change "mountpoint1" and "mountpoint2" to the correct names.
Chroot to the new partition:
Code:
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /media/mountpoint2$i; done
Be sure to change "mountpoint2" to the correct name.
Code:
 sudo chroot /media/mountpoint2
Refresh the initfs:
Code:
update-initramfs -u
Install Grub to the approprate drive - sdc? sdb?
Code:
grub-install --recheck /dev/sdc
Code:
update-grub
Open /etc/fstab in your text editor: (mine is gedit)
Code:
gedit /etc/fstab
Enter the new UUID number for your new / partition. Save and exit.
CTRL-D to exit chroot
CTRL-D to exit the terminal

Wow!
Thanks for all this. I only recognize a little bit of those terminal code entries. better than i was a month ago though
I will look all this over and re read it so I dont just copy/paste before i know what the heck i just did
Part of Linux and Mint (Mate) in particular, is I am able to learn lots of new things if I take a few minutes to look at what is happening. It has become less daunting and more fun-which is half the battle. and, for me, more to the point of using it in the first place
People like you folks here are instrumental in me being able to use it at all, and I appreciate it very much.
I will be getting to this in a little while and trying it out, not that this is some pressing task or ,even close to monumental in the course of things
But it will, hopefully, get the computer to boot a lot faster than it currently does. One improvement for free is a step in the right direction
thanks again
john
 
Old 02-28-2016, 06:38 AM   #12
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Here is a well-written and more detailed description of the same process I described above, using rsync →
How to copy a Mint installation and boot it

I have cloned a / partition with gparted many times (simple Copy and Paste into unallocated space), and you do have to worry about the duplicate UUID numbers. You can use Gparted to assign a new UUID number immediately after the Paste, and then you use the chroot process to update Grub, fstab, and the initfs.
Using rsync is more versatile, tho, and faster.

Last edited by TxLonghorn; 02-28-2016 at 06:42 AM.
 
2 members found this post helpful.
Old 02-28-2016, 09:04 AM   #13
johnniedoo
Member
 
Registered: Jun 2014
Location: USA
Distribution: MINT17.3 Mate, Cinnamon , Mint MATE 18.1
Posts: 73

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TxLonghorn View Post
Here is a well-written and more detailed description of the same process I described above, using rsync →
How to copy a Mint installation and boot it

I have cloned a / partition with gparted many times (simple Copy and Paste into unallocated space), and you do have to worry about the duplicate UUID numbers. You can use Gparted to assign a new UUID number immediately after the Paste, and then you use the chroot process to update Grub, fstab, and the initfs.
Using rsync is more versatile, tho, and faster.
COOL!!
Thanks for that link,too. made my eyes spin around in their sockets first time through it. I am on the 3rd re-read. I never used(or heard of) rsync up till last week. Gparted seemed risky enough, but , at least I have plenty of experience using it over the past year . It is how i first set up Mint from the live CD and now USB drives. I am sort of comfortable with it by now.
Again, thanks, am about to boot from the live usb soon
John
 
Old 02-28-2016, 09:25 AM   #14
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,988
Blog Entries: 33

Rep: Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471
syg00,

Quote:
Thinking more on this, I'm not sure what Clonzilla will do with the UUID of the target partition (on the SSD). You may well finish up with both partitions with the same UUID. That will be a problem.
You are dead right. I remember screwing things up royally some years ago whilst cloning and ended up with identical UUIDs.

Not recommended!
 
1 members found this post helpful.
Old 02-28-2016, 09:26 AM   #15
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,988
Blog Entries: 33

Rep: Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471Reputation: 1471
TxLonghorn,

Quote:
Here is a well-written and more detailed description of the same process I described above, using rsync →
How to copy a Mint installation and boot it
Very useful.

Thanks for that.
 
1 members found this post helpful.
  


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
Access To Encrypted SSD Partition With Native Password in SSD>SATA Enclosure skidvicious Linux - Hardware 5 12-03-2015 04:40 PM
[SOLVED] How to Partition Win 7 HDD for Linux Mint 17 install green ice Linux - Software 48 09-05-2015 03:59 PM
[SOLVED] Installing Fedora21 on two drives 120G SSD and 2TB HDD, how to partition? revmrblack Fedora - Installation 16 06-17-2015 05:18 PM
Partition/format advice: SSD + HDD, MBR/GPT mixture, win7 x64 dual-boot dad_ Linux - Hardware 6 01-17-2015 12:34 PM
[SOLVED] Using both SSD/HDD for partitioning or is it better to just get external HDD? Switch7 Linux - Hardware 16 10-26-2009 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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