[SOLVED] Howto change sdb from 500GB to 1TB?

This forum is dedicated to basic help and support :

Ask here your questions about basic installation and usage of Mageia. For example you may post here all your questions about getting Mageia isos and installing it, configuring your printer, using your word processor etc.

Try to ask your questions in the right sub-forum with as much details as you can gather. the more precise the question will be, the more likely you are to get a useful answer

[SOLVED] Howto change sdb from 500GB to 1TB?

Postby janpihlgren » Mar 17th, '14, 08:20

I'm using ThinkPad W701 with Mageia 4. My sda is 320 GB where the OS is located. My sdb is 500 GB where I store virtual OSes for VMware Workstation. The size of sdb begin to be too little so I whish to change to a bigger one, 1 TB. I have already purchased the harddrive, 2,5" Hitachi HTS541010ASE680.
I have the idea that after switching the disks format the disk (sdb) and then copy data from the old disk to the new one.
When I do the switching the computer will only start to terminal and maintenance mode. The sdb will be located when I run fdisk -l.
Before switching I unmount sdb.
What to do to have Mageia up and running in normal, GUI, mode?
Do I have to clone the disks before switching? I'm a little scary to do cloning because I'm afraid to do it the wrong way.
Last edited by janpihlgren on Mar 17th, '14, 15:57, edited 1 time in total.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: Howto change sdb from 500GB to 1TB?

Postby magfan » Mar 17th, '14, 10:45

Once I did it like this:

1. connecting the new drive via USB (-> /dev/sdc)
2. formatting the new drive
3. creating a new partition on the new drive (-> /dev/sdc1)
4. copying everything from /dev/sdb1 to /dev/sdc1 (running "cp -a" as root)
5. changing /etc/fstab (very important!)
6. shutdown the system
7. removing old disk
8. building in new disk
9. starting the system
10. changing /etc/fstab

Point 5 is very important. You have to exchange the UUID of your old drive with the device path:
Code: Select all
UUID=... /your_mountpoint ext4 acl,relatime 1 2

to

/dev/sdb1 /your_mountpoint ext4 acl,relatime 1 2


Once you rebooted your system you can replace the device path with the UUID of the new disk.
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: Howto change sdb from 500GB to 1TB?

Postby wintpe » Mar 17th, '14, 11:38

ideally

you should no longer refer to file systems in fstab with there old scsi disk names, as these change during device scanning.

and /dev/sdb1 could be /dev/sdc1 if a new disk is added.

this could mean, that adding a usb drive at switch on time causes the system to go single user.

use the CLI command : blkid to find the UUID of the new filesystem you want to mount and add that instead

ie UUID=cryto-likestring-of-blkid

of the scsi disk path.

the reason your system starts up in single user mode is any filesystem, that either does not fsck, or show clean status or that disappears from fstab
means the system is in jeopardy, and the system holds at single user readonly mounted root to prevent any further action happening until things are set right.

at the single user prompt you can enter the root password, followed by

mount -o remount /

this will mount / (or root filesysystem) as read write

and you can now edit fstab and hash out the offending file system to get the system running in gui mode (providing of course that what you hash out is not depended upon for starting in run level 5, like /home for example)



regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Howto change sdb from 500GB to 1TB?

Postby magfan » Mar 17th, '14, 12:19

Of course it should be verified that the new USB device really is /dev/sdc. Also, before formatting you always have to check whether the device you are going to format is empty. Or at least it should be the device you want to format.

As I mentioned before I had to do this some time ago and it worked - even under mga4. But if I understand it correctly I should better do something like:

1. connecting the new disk via USB
2. getting the UUID of the new disk
3. changing /etc/fstab (=adding a new line for the new disk with its UUID and removing/commenting out the line for the old disk)
4. formatting the new disk
5. creating a new partition on the new disk
6. copying everything from the old disk to the new disk
7. shutdown the system
8. removing old disk
9. building in new disk
10. starting the system
magfan
 
Posts: 334
Joined: Apr 3rd, '12, 12:33

Re: Howto change sdb from 500GB to 1TB?

Postby janpihlgren » Mar 17th, '14, 12:52

I understand.
I just doing copy from old sdb to the new one, its lot of data copy.
I'll return and tell how it's going.
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden

Re: Howto change sdb from 500GB to 1TB?

Postby wintpe » Mar 17th, '14, 13:33

magfan

you had everything right, just the UUID ideally should be done.

just to be clear, there can be a UUID of the disk, when used with LVM, and there is a UUID of the file system, they are different.

but blkid returns the UUID of the file system.

UUID's are getting used in more than just disks to tag things with a Unique reference.

whats is a filesystem, the ext4 , bit created with mkfs.ext4 on the device, hence why i dont refer to the disk, which can be seen with fdisk -l
with or without a filesystem in place.

its a filesystem you mount via fstab, not a disk.

hopefully that has not created more confusion......

regards peter
Redhat 6 Certified Engineer (RHCE)
Sometimes my posts will sound short, or snappy, however its realy not my intention to offend, so accept my apologies in advance.
wintpe
 
Posts: 1204
Joined: May 22nd, '11, 17:08
Location: Rayleigh,, Essex , UK

Re: Howto change sdb from 500GB to 1TB?

Postby janpihlgren » Mar 17th, '14, 15:56

I thank You for the help. It solved my problem. Spacial you magfan,
Specific the point 3 on your last post,
Thank you. :)
User avatar
janpihlgren
 
Posts: 294
Joined: Mar 30th, '11, 12:23
Location: Marsta, Sweden


Return to Basic support

Who is online

Users browsing this forum: No registered users and 1 guest

cron