LinuxQuestions.org
Help answer threads with 0 replies.
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 10-04-2018, 10:21 PM   #1
jimithy
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Rep: Reputation: Disabled
Can I text someone who has installed an SSD in a Laptop using Ubuntu ? Need to know about cloning and partitions.


Im using Ubuntu Linux with a Kingston 120g SSD
and getting close to the memory max (112 gb) and
want to buy a 240gb 2.5 x 7mm Sata drive replacement
for this 64 bit HP g6 Pavilion Laptop.

And want to know about cloning and partitions
using Ubuntu. I have the USB cable for cloning
the SSD.

Thank you,

Jimithy

Last edited by jimithy; 10-04-2018 at 11:18 PM. Reason: Remove email adr for security reasons.
 
Old 10-04-2018, 10:36 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,444
Blog Entries: 25

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Why not just frame your questions and ask them here? The purpose of LQ is to get questions and answers out in the open so others can learn from them.

In addition, you can use the LQ Search up there at the top of the window to look for posts that have already addressed this topic. SSDs have been around for quite a while now and I have a dollar to a doughnut that there are a number of LQ threads on them.

Also, off the top of my head, your best bet is likely to back up your data to an external USB HDD (they are cheap these days) and then restore it to your new installation, rather than to try to clone it.

Speaking for myself, I would not be willing to attempt to address a topic as large as this one via text messages.

Also, it would be wise to remove your email from your post. By putting it out there, you make it a target for harvesting by spammers.

Just my two cents.

Last edited by frankbell; 10-04-2018 at 10:37 PM.
 
1 members found this post helpful.
Old 10-04-2018, 11:10 PM   #3
jimithy
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Cloning and partition questions.

Thank you Frankbell,

I saw some related SSD topics at the bottom of the screen that I didn't see before when
doing a search.

Flash drives are being used for photos, files etc...now to reduce SSD memory on the 120g SSD
and a 64g flash could probably hold all my data but was hoping to be able to retain all the
passwords stuff for email etc...intact by cloning....before installing the new SSD... probably
not possible ?

Also right now 4 old Ubuntu 25gb partitions are seen w/ System partition Editor that are idle and seemingly not used for anything and possibly resulted from re-installing Ubuntu a number of times.
Can I delete old Ubuntu partitions that I assume are not required, and if so,
how ? Will they go into trash ? Then can the partitions be returned to local storage ?

These are the main questions Frank. If I can delete these partitions (not locked under the "/" symbol)
then won't have to buy a new SSD :-) and go through all the password stuff.
Hope this makes sense. If not please tell me.

Thanks,

Jimithy
 
Old 10-04-2018, 11:33 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 15,444
Blog Entries: 25

Rep: Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447Reputation: 4447
Thanks for your kind response.

You cannot delete partitions in the same way that you delete files. You need to use a partition manager such as GPartEd or (for us old-timers, fdisk or cfdisk) to manage partitions. In tech-speak, you could remove the partitions, which would delete all their data, making the space they occupy "unallocated," then apply that unallocated space to other partitions or to new partitions. (Just between you and me, I wouldn't have understood a word of this 15 years ago!)

It is late here and I am too tired to go into detail, but you might want to listen to the first part of episode 352 of the Going Linux podcast, in which repartitioning is discussed. I'm not saying it will answer your question, but I think it will give you a good starting point of introductory knowledge.
 
1 members found this post helpful.
Old 10-04-2018, 11:57 PM   #5
jimithy
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thank you Frank....
Do you think the old data in the partitions are being used for anything
and can safely be deleted ?

I will listen to the first part of episode 352 of the Going Linux podcast, about repartitioning

Thanks again...

Jim
 
Old 10-05-2018, 01:09 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,143

Rep: Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935
Let's find out - do you know how to use a terminal ?. If so open terminal and run these commands - copy-and-paste the results back here.
Code:
lsblk -f
sudo parted /dev/sda "print free"
 
1 members found this post helpful.
Old 10-05-2018, 04:06 AM   #7
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 3,120

Rep: Reputation: Disabled
Likely easiest to back up your data, if you use Firefox, (all your passwords are in your .mozilla directory) just copy that directory over as well, then re instate it to your newly installed system in your home directory, (you will likely have to change permissions to yourself on it before it works). I do it all the time, saves a lot of typing.
 
1 members found this post helpful.
Old 10-05-2018, 09:23 AM   #8
jimithy
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
syg00 and Fatmac and Frankbell...I am learning so much in a very short time... THANK YOU !

After coffee can't wait to get into this...And I assume LQ means Lotsa Questions ?
 
Old 10-05-2018, 09:41 AM   #9
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Honestly, the solution to your problem is a lot simpler and a lot more turn-key than folks here are making out.

As I see it, what you really want is a way to simply migrate your entire Linux install from your current drive to your replacement drive. The simplest way to do this is with "dd" - a dumb utility which will let you clone the contents of one drive to another (assuming no unrecoverable disc errors). After doing this, you can then resize existing partitions or create a new partition to utilize the extra space.

The main issue with this method is that you end up with cloned partition UUIDs also. This can lead to severe confusion if both drives are connected to the same computer at the same time. However, this is generally not a big deal for laptops, since you usually only have one drive connected.

The basic steps are:

1) Shutdown computer

2) Attach new drive

3) Boot up by a liveCD or liveUSB or something

4) Log in as root and use something like this to copy clone over the drive:

Code:
fdisk -l
This will tell you what devices are which. The internal drive is likely /dev/sda. The new drive is likely /dev/sdc or /dev/sdb (depending on your liveUSB or whatever).

Study the output of fdisk -l carefully! Make sure you know what the source and destination are!

Then use the following to clone the drive:

Code:
dd if=/dev/sda of=/dev/sdc bs=32256
The exact block size is unimportant. I just use 32256 because that's what was suggested in the how-to I learned this from (from the JustLinux forums).

5) Use gparted to resize/move/create partitions on the new drive as desired. One potential gotcha - if you've got swap partitions, don't move or resize them for now. I find that this may result in changed UUIDs, which can then cause some boot issues as the expected UUID is not found. However, it is safe to move/resize ext4 partitions--they'll keep the same UUID unless you explicitly reformat them.

6) Shutdown the computer and swap the new drive in place.

That's it!

If you do not have a liveCD/liveUSB handy, it actually is possible to use dd to copy the current SSD while it's in use. This may cause some file system errors, similar to what happens when a computer suddenly powers down unexpectedly. After the disc swap, the file system check on bootup may have to fix these things but otherwise the computer will come up just fine.

Last edited by IsaacKuo; 10-05-2018 at 09:42 AM.
 
1 members found this post helpful.
Old 10-05-2018, 10:03 AM   #10
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,513

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
OK, just a footnote about duplicate UUIDs. If you have trouble mounting a drive, you can run 'dmesg', and view why it didn't mount. If it says 'duplicate uuid', you can mount with '-o nouuid' with certain file systems.
 
1 members found this post helpful.
Old 10-05-2018, 10:40 AM   #11
jimithy
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Hi Isaac,
There are terms that I am not familiar with and hope to learn to make a start-up boot CD, what UUID and login as Root means ?

I am a dinosaur in my EXTREMELY late 70s but luv this stuff and esp. all the amazing helpers here !!!

Thank you for your patience...

Jim
 
Old 10-05-2018, 10:42 AM   #12
jimithy
LQ Newbie
 
Registered: Oct 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
More... BTW I can use terminal and a little familiar with Unix.
 
Old 10-05-2018, 01:45 PM   #13
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,349
Blog Entries: 8

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
A liveCD or liveUSB is essentially a Linux OS that boots off of CD or USB thumbdrive, rather than an internal hard drive or SSD.

If you boot off of the internal SSD, then the OS partition (at least) will be mounted and possibly active during the time that "dd" copies the contents from it to the external SSD. As I note at the bottom, this is not necessarily a problem. You can actually do it that way. It's just that all how-to's I've ever read recommend not doing it like that.

UUID is a globally unique random number used to identify things - in this case, each partition has its own UUID. Typically, the GRUB2 or EFI will identify the OS partition by UUID, and typically /etc/fstab refers to partitions by UUID. This means that you can't just copy the contents within each partition's file system to partitions in the new SSD and expect it to work. If you create new partitions with gparted, for example, they will be created with all new UUIDs.

But if you clone the contents of the drive itself, then the partition UUIDs will get copied along with everything else.

To log in as root, with Ubuntu, you can log into a command line and type in the following command:
Code:
sudo su
This is a bit different from how you'd typically log in as root on other Linux distributions, or most *nix's, where you'd typically just type in the command "su". But in any case it'll work.
 
1 members found this post helpful.
Old 10-05-2018, 04:11 PM   #14
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Distribution: Linux Mint XFCE
Posts: 822

Rep: Reputation: 232Reputation: 232Reputation: 232
I agree with Fatmac above. When my drive went bad and I replaced it, it was so fast to just copy off data files to USB drive, install the OS fresh and copy the data files back over. I went from a 1TB hybrid drive to a 250GB SSD and it was much easier to install than putz with different size drives.

Last edited by jkirchner; 10-05-2018 at 04:13 PM.
 
1 members found this post helpful.
Old 10-05-2018, 07:53 PM   #15
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 18,143

Rep: Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935Reputation: 2935
If the OP can simply delete some unused partitions and not even have to buy a bigger SSD, why not keep all the advice simple/relevant ?.
When we get some real data as requested, we'll be able to make better suggestions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Removing Partitions from a SSD Asus EEE laptop mickeyboa Fedora 2 03-08-2017 02:49 PM
Cloning SSD vs HDD with DD replica9000 Linux - Software 13 12-16-2016 08:08 PM
Cloning HDD install to SSD Condemn Slackware 1 02-14-2014 07:58 AM
[SOLVED] SSD cloning quick question lpallard Linux - Hardware 13 02-22-2011 06:22 PM
cloning mixed Linux - Win xp on new SSD for laptop trentfox Linux - Hardware 3 02-09-2010 07:46 PM

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

All times are GMT -5. The time now is 07:57 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration