Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Migrating to new HDD and modifying the file set up [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Mon Sep 07, 2015 4:20 pm    Post subject: Migrating to new HDD and modifying the file set up [solved] Reply with quote

Hi all,

I've recently purchased a new 3TB HDD for my old machine. What I'd like to do is migrate my current install to the new HDD. In addition, I'd like to create a separate partition for all of my media files (music, videos, etc.) and have that easily accessible. I'm thinking something like 100GB home and a bit extra for the boot, root, and swap directories, and then the rest of the drive for the videos, etc. What I need to know is what kind of partitioning scheme would work (I've only had very simple ones thus far) and what I need to do with fstab so that I can easily access all the stuff on the media partition.

Best,

Alex


Last edited by evoweiss on Thu Sep 17, 2015 8:21 pm; edited 1 time in total
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Mon Sep 07, 2015 4:51 pm    Post subject: Reply with quote

I cant advice about partitioning scheme, but you need to go GPT.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Mon Sep 07, 2015 5:06 pm    Post subject: Reply with quote

Buffoon wrote:
I cant advice about partitioning scheme, but you need to go GPT.


Is there any reason why fdisk won't cut it?

Best,

Alex
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Mon Sep 07, 2015 5:06 pm    Post subject: Reply with quote

evoweiss,

As buffon says, you will need GPT.

GPT and BIOS works fine but there is a trap for the unwary if you need to set the boot flag.
It must be in the MSDOS partiton table, not the GPT. You still get a fake MSDOS partition table for free.

If you are worried about getting partitioning right, use LVM. That lets you grow volumes on the fly, while they are mounted even.
You can shrink volumes too but thas a bit harder.

Partition you new HDD as you like - with LVM, or not and make your filesystems.

Boot a CD/USB or whatever and mount your existing install ro at /mnt/gentoo.
The Read Only is important. It will stop you destroying your install if you mess up later.

Mount your new directory tree at /mnt/new This needs to be read/write.
Now copy everything from /mnt/gentoo to /mnt/new, preserving permissions.
cp -a works, as does tar and rsync.

chroot /mnt/new and install Grub.
touch /new_install too, so you can tell them apart.

Disconnect the old HDD and boot the new install.
Make a note of the error messages and fix stuff :)
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Mon Sep 07, 2015 5:10 pm    Post subject: Reply with quote

Hi Neddy,

Thanks. Is that all still needed if I am installing it on a c. 2002 computer? If so, not a problem.

Is there a guide to doing what I have to do with respect to the partition table, etc.?

Best,

Alex

NeddySeagoon wrote:
evoweiss,

As buffon says, you will need GPT.

GPT and BIOS works fine but there is a trap for the unwary if you need to set the boot flag.
It must be in the MSDOS partiton table, not the GPT. You still get a fake MSDOS partition table for free.

If you are worried about getting partitioning right, use LVM. That lets you grow volumes on the fly, while they are mounted even.
You can shrink volumes too but thas a bit harder.

Partition you new HDD as you like - with LVM, or not and make your filesystems.

Boot a CD/USB or whatever and mount your existing install ro at /mnt/gentoo.
The Read Only is important. It will stop you destroying your install if you mess up later.

Mount your new directory tree at /mnt/new This needs to be read/write.
Now copy everything from /mnt/gentoo to /mnt/new, preserving permissions.
cp -a works, as does tar and rsync.

chroot /mnt/new and install Grub.
touch /new_install too, so you can tell them apart.

Disconnect the old HDD and boot the new install.
Make a note of the error messages and fix stuff :)
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Mon Sep 07, 2015 5:11 pm    Post subject: Reply with quote

evoweiss,

New fdisk will make a GPT disklable, old fdisk only does MSDOS.
MSDOS breaks hard at 2.0TiB. so you would loose about 800G of your new drive.

GPT will give you 255 primary partitions, so no need to 'faff' about with the extended partition.
It will let you have an extended partition if you want.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Mon Sep 07, 2015 5:19 pm    Post subject: Reply with quote

Just do not forget to turn on GPT in your kernel.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Mon Sep 07, 2015 5:21 pm    Post subject: Reply with quote

evoweiss,

You don't really need a guide. The Gentoo hanndbook covers partitioning and making filesystems.
If you want more than /boot / and swap, that's ok. Update /etc/fstab accordingly.

If you intend to use LVM, you have /boot and the rest of the drive donated to LVM, then creale Logical Volumes which host your files sytems. With root on a logical volume, you need an initrd to mount it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Mon Sep 07, 2015 6:57 pm    Post subject: Reply with quote

Hi all,

Many thanks. I'll give it a go this weekend.

Best,

Alex
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Sun Sep 13, 2015 10:27 am    Post subject: Reply with quote

Hi all,

I'm a bit lost in all of this and the install guide, unfortunately, hasn't been very clear.

NeddySeagoon wrote:

GPT and BIOS works fine but there is a trap for the unwary if you need to set the boot flag.
It must be in the MSDOS partiton table, not the GPT. You still get a fake MSDOS partition table for free.


I assume I have to set the boot flag as this will be the boot disk. However, I simply cannot work out how this is done from the install guide. Would you be so kind as to clarify this for me? It's unusual because the install guide is usually clear on most things. I suspect it's because I am working with an older system.

Best,

Alex
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Sun Sep 13, 2015 10:50 am    Post subject: Reply with quote

evoweiss,

The install guide says
https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#GPT_or_MBR wrote:
Some buggy BIOSes or EFIs configured to boot in BIOS/CSM/legacy mode might also have problems with booting from GPT labeled disks. If that is the case, it might be possible to work around the problem by adding the boot/active flag on the protective MBR partition which has to be done through fdisk with the -t dos option to force it to read the partition table using the MBR format.


You have two partiton tables when you use GPT. The real GPT one, which everything except the BIOS will use and a fake MSDOS partition table, containing one partition, which will only be used by the BIOS. Do not do anything with the fake/protective MSDOS partition table except set the boot frag.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Sun Sep 13, 2015 11:06 am    Post subject: Reply with quote

NeddySeagoon wrote:
evoweiss,

The install guide says
https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#GPT_or_MBR wrote:
Some buggy BIOSes or EFIs configured to boot in BIOS/CSM/legacy mode might also have problems with booting from GPT labeled disks. If that is the case, it might be possible to work around the problem by adding the boot/active flag on the protective MBR partition which has to be done through fdisk with the -t dos option to force it to read the partition table using the MBR format.


You have two partiton tables when you use GPT. The real GPT one, which everything except the BIOS will use and a fake MSDOS partition table, containing one partition, which will only be used by the BIOS. Do not do anything with the fake/protective MSDOS partition table except set the boot frag.


I saw that. Does this mean I simply set that up and then proceed through the gpt instructions for setting up partitions, etc. that starts at:

Quote:
Default: Using parted to partition the disk


Best,

Alex
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Sun Sep 13, 2015 2:10 pm    Post subject: Reply with quote

evoweiss,

Use parted to set up your GPT partiton table.
It will also create your protective MSDOS partition table.

When you have finished with parted and before you reboot, use
Code:
fdisk -t dos /dev/sd...
to set the boot flag on.
The MSDOS partition table will only contain one entry.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Sun Sep 13, 2015 6:11 pm    Post subject: Reply with quote

NeddySeagoon wrote:
evoweiss,

Use parted to set up your GPT partiton table.
It will also create your protective MSDOS partition table.

When you have finished with parted and before you reboot, use
Code:
fdisk -t dos /dev/sd...
to set the boot flag on.
The MSDOS partition table will only contain one entry.


Many thanks... at present, cp -a /mnt/gentoo/* /mnt/new is doing its thing.

I'll have to buy you a pint one of these days.

Best

Alex
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Sun Sep 13, 2015 8:58 pm    Post subject: Reply with quote

Hi there,

I'm one step closer. I copied over the drive, reinstalled grub2, etc. There were some errors about nodes not being found, however, and the system won't boot off the new drive. I get something like:

Code:

not syncing: VFS unable to mount root fs on unknown block (0,0) ... Comm: swapper/0 Not tainted


In threads on this I saw that lspci -k was helpful for figuring this out. Mine (after chrooting) is as follows:

Code:


pcilib: Cannot open /proc/bus/pci
00:00.0 Host bridge: Intel Corporation 82875P/E7210 Memory Controller Hub (rev 02)
   Subsystem: Dell 82875P/E7210 Memory Controller Hub
lspci: Unable to load libkmod resources: error -12
00:01.0 PCI bridge: Intel Corporation 82875P Processor to AGP Controller (rev 02)
00:06.0 System peripheral: Intel Corporation 82875P/E7210 Processor to I/O Memory Interface (rev 02)
00:1d.0 USB controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #1 (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) USB UHCI Controller
00:1d.1 USB controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #2 (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) USB UHCI Controller
00:1d.2 USB controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #3 (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) USB UHCI Controller
00:1d.3 USB controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB UHCI Controller #4 (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) USB UHCI Controller
00:1d.7 USB controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) USB2 EHCI Controller
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev c2)
00:1f.0 ISA bridge: Intel Corporation 82801EB/ER (ICH5/ICH5R) LPC Interface Bridge (rev 02)
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) IDE Controller
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
   Subsystem: Dell 82801EB (ICH5) SATA Controller
00:1f.3 SMBus: Intel Corporation 82801EB/ER (ICH5/ICH5R) SMBus Controller (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) SMBus Controller
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller
02:00.0 PCI bridge: Pericom Semiconductor PI7C9X111SL PCIe-to-PCI Reversible Bridge (rev 01)
02:02.0 Communication controller: Conexant Systems, Inc. Device 2702 (rev 01)
   Subsystem: Dell Device 8d88
02:08.0 Ethernet controller: Intel Corporation 82562EZ 10/100 Ethernet Controller (rev 02)
   Subsystem: Dell 82562EZ 10/100 Ethernet Controller
03:00.0 VGA compatible controller: NVIDIA Corporation GF119 [GeForce GT 610] (rev a1)
   Subsystem: ZOTAC International (MCO) Ltd. GF119 [GeForce GT 610]
03:00.1 Audio device: NVIDIA Corporation GF119 HDMI Audio Controller (rev a1)
   Subsystem: ZOTAC International (MCO) Ltd. GF119 HDMI Audio Controller


Any ideas what needs to be enabled in the kernel (I'm running 4.0.5).

Best,

Alex
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Sun Sep 13, 2015 9:50 pm    Post subject: Reply with quote

evoweiss,

Code:
unknown block (0,0)
means that the kernel can't even see your HDD.
You did enable GPT Support in the kernel?
Code:
EFI_PARTITION=y


If you run lspci -k outside the chroot, it will tell you the kerner modules in use. No matter.

Code:
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) IDE Controller
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
   Subsystem: Dell 82801EB (ICH5) SATA Controller

Those both use the same driver, so its unlikely you have
Code:
<*>       Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
missing.
Code:
ATA_PIIX=y

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Sun Sep 13, 2015 10:07 pm    Post subject: Reply with quote

NeddySeagoon wrote:
evoweiss,

Code:
unknown block (0,0)
means that the kernel can't even see your HDD.
You did enable GPT Support in the kernel?
Code:
EFI_PARTITION=y


If you run lspci -k outside the chroot, it will tell you the kerner modules in use. No matter.


I'll bear that in mind for next time.

Quote:

Code:
00:1f.1 IDE interface: Intel Corporation 82801EB/ER (ICH5/ICH5R) IDE Controller (rev 02)
   Subsystem: Dell 82801EB/ER (ICH5/ICH5R) IDE Controller
00:1f.2 IDE interface: Intel Corporation 82801EB (ICH5) SATA Controller (rev 02)
   Subsystem: Dell 82801EB (ICH5) SATA Controller

Those both use the same driver, so its unlikely you have
Code:
<*>       Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
missing.
Code:
ATA_PIIX=y


Thanks, though I was just about to post that I found the magic kernel configuration that was needed. The system is booting up now. I had some errors but that was fixed when I modified /etc/fstab. I needed to set CONFIG_PATA_OLDPIIX=y.


One error remains, though it doesn't seem to have an effect. Still, I would like it to go away! What I see upon booting is something like:

Code:

sda4 couldn't mount because of unsupported optional features (240)


I see it largely doesn't matter (or seem to), but I'd like to vanquish it nonetheless.

Best,

Alex

Edit: I thought it might be because /etc/fstab has the boot partition as ext3 whereas it's ext2, but changing fstab didn't make it go away. So I am stuck for now, but not in the worst possible place. Thanks again and I am sure I'll get everything fixed tomorrow thanks to your help.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44198
Location: 56N 3W

PostPosted: Mon Sep 14, 2015 10:37 pm    Post subject: Reply with quote

evoweiss,

Code:
sda4 couldn't mount because of unsupported optional features (240)


The kernel has to mount root before in can read /etc/fstab.
If you use extX, The kernel tries ext3, ext2 then ext4.

IF you tell the kernel your rootfs type, it goes straight to it.

Add
Code:
rootfs=ext3
or whatever to your kerner command line.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
evoweiss
Veteran
Veteran


Joined: 07 Sep 2003
Posts: 1677
Location: Edinburgh, UK

PostPosted: Tue Sep 15, 2015 8:16 pm    Post subject: Reply with quote

NeddySeagoon wrote:
evoweiss,

Code:
sda4 couldn't mount because of unsupported optional features (240)


The kernel has to mount root before in can read /etc/fstab.
If you use extX, The kernel tries ext3, ext2 then ext4.

IF you tell the kernel your rootfs type, it goes straight to it.

Add
Code:
rootfs=ext3
or whatever to your kerner command line.


That did the trick, thanks!

Best,

Alex
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum