LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Preparing a hard disk for linux distros only (dualboot from 2 hard disks) (https://www.linuxquestions.org/questions/linux-newbie-8/preparing-a-hard-disk-for-linux-distros-only-dualboot-from-2-hard-disks-4175529934/)

Higgsboson 01-03-2015 01:23 PM

Preparing a hard disk for linux distros only (dualboot from 2 hard disks)
 
Hello everyone.
After reading dualboot threads I find that dualboot issues seem to be unique to each user. However, I want a simple setup which others may want.

I have Windows 7 on a SATA hdd and my old IDE drive was part of it's filesystem. I physically removed the IDE drive and Windows refused to work. I then did a Windows repair from the installation disk and now the Windows OS boots only from the SATA hdd. It doesn't detect the IDE drive because it's not connected.

I then connected the old IDE drive back in and BIOS detects it without problems. I don't want to boot into Windows as I think it will make the IDE drive part of its filesystem again (the IDE drive is in NTFS filesystem).
So I want to prepare the IDE drive for linux distros in ext4 filesystem format.

Firstly, I would like to know if Windows 7 will freak out if it detects a hdd in ext4 format. This is because I don't think it can write files to the drive.

Secondly, I want to prepare the old IDE hdd for linux distros. It's 160gb and I want 4 distros in 40gb partitions each. So that means 3 primary partitions with 1 extended partition which houses 1 logical partition. I believe that's correct.

I don't want complicated swap files or swap partitions. A linux distro in a 40gb partition with the modest 2gb RAM I have should be enough for a normal user like me.

So can someone please say if Windows 7 on the seperate sata hdd will freak out if it sees an IDE drive in ext4 filesystem format?
Also, can I go ahead and use gparted or something and prepare a nice living space for linux distros on my old IDE hdd?

Thank you very much for your time.

Head_on_a_Stick 01-03-2015 01:40 PM

Windows cannot read ext4 and will tell you the disk needs to be formatted, but you should be able to tell it not to.

Have you tried removing the drive letter to which it was assigned from Windows Explorer?

If you use gparted to clear the current partition table and create some new ones, I don't think Windows will even recognise it as the old drive (I could be wrong though).

yancek 01-03-2015 02:06 PM

Many Linux distributions have GParted (Partition manager) on the installation medium. Use that to format the IDE drive. You need to verify that you have the right drive based on size or some other obvious difference since both drives are ntfs. You can create a new partition table with GParted or delete partitions and then format them or just format the partitions with ext4 or whichever filesystem you want.

Higgsboson 01-03-2015 02:19 PM

Quote:

Originally Posted by Head_on_a_Stick (Post 5294865)
Have you tried removing the drive letter to which it was assigned from Windows Explorer?

I haven't gone into Windows yet. Not while the hdd is still in NTFS format.

Quote:

If you use gparted to clear the current partition table and create some new ones, I don't think Windows will even recognise it as the old drive (I could be wrong though).
Yes, that's what I was thinking too. I'll need to reformat the hdd into ext4 format so linux distros can work easily.
I could simply use the fdisk command as well as gparted - I'm not familiar with gparted.
However, I'm wondering if I should reformat the whole drive first into ext4 format?

Higgsboson 01-03-2015 02:25 PM

Quote:

Originally Posted by yancek (Post 5294878)
Many Linux distributions have GParted (Partition manager) on the installation medium. Use that to format the IDE drive. You need to verify that you have the right drive based on size or some other obvious difference since both drives are ntfs. You can create a new partition table with GParted or delete partitions and then format them or just format the partitions with ext4 or whichever filesystem you want.

Ok, I'll use gparted.

However, what about the idea of splitting a 160gb IDE drive into four 40gb partitions for 4 distros? Is that gonna be ok?

EDDY1 01-03-2015 02:35 PM

If you're uncomfortable working with all of your disks accessible, you can either disable the sata drive in bios or disconnect it. Me myself I don't worry about it as debian gives me the option to install bootloader on any drive. If I'm installing to sdb & also put grub there the only thing that might change on sda is the boot flag, which I can easily change with gparted.
If you're installing linux to the ide drive you can just select that drive & repartition it during installation.

Head_on_a_Stick 01-03-2015 02:36 PM

Quote:

Originally Posted by Higgsboson (Post 5294891)
However, what about the idea of splitting a 160gb IDE drive into four 40gb partitions for 4 distros? Is that gonna be ok?

Sounds good to me -- I prepared a GNU/Linux "sampler" drive for my Dad which was the same size; I think it ended up with 5 different distributions each with ~30GiB.

The Debian system I am posting this from has a full GNOME desktop with LibreOffice & lots of other stuff and the 12GiB partition is only 2/3 full...

Higgsboson 01-03-2015 03:02 PM

Quote:

Originally Posted by EDDY1 (Post 5294895)
If you're uncomfortable working with all of your disks accessible, you can either disable the sata drive in bios or disconnect it. Me myself I don't worry about it as debian gives me the option to install bootloader on any drive.

Yes. That's the setup I'm hoping to achieve once I've got a proper distro on a hdd. I only have live debian USB at the moment.

Quote:

If you're installing linux to the ide drive you can just select that drive & repartition it during installation.
That's a good point. The thing with linux is that there are so many ways of doing the same thing. I'm going to stick with partitioning the hdd with gparted first, and then installing a distro.

Head_on_a_Stick 01-03-2015 03:12 PM

FWIW I have noticed that the Debian installer can bug-out and freeze up if you try to use the partitioner provided with the installer so I think that partitioning beforehand is probably a good idea.

Higgsboson 01-03-2015 03:18 PM

Quote:

Originally Posted by Head_on_a_Stick (Post 5294897)
Sounds good to me -- I prepared a GNU/Linux "sampler" drive for my Dad which was the same size; I think it ended up with 5 different distributions each with ~30GiB.

The Debian system I am posting this from has a full GNOME desktop with LibreOffice & lots of other stuff and the 12GiB partition is only 2/3 full...

Ha! That's the great thing about Debian - there's no extra pgms taking up space and memory. When I'm on Windows - antivirus, Windows update, and unknown stuff are always whirring away constantly!

I'm going to look up some stuff on gparted and prepare this hdd.
I have some dvd-rw coming soon so I can install some distros. However, I may have a go at debootsrap before then! Will keep you posted.

Higgsboson 01-06-2015 07:36 AM

I have used gparted to create partitions on my hdd to be used exclusively for linux distros.
The output for the partitions is as follows:

Code:

root@debian:/# fdisk -l /dev/sda
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x9b3c9b3c

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1            2048    81922047    40960000  83  Linux
/dev/sda2        81922048  163842047    40960000  83  Linux
/dev/sda3      163842048  245762047    40960000  83  Linux
/dev/sda4      245762048  312580095    33409024    5  Extended
/dev/sda5      245764096  307204095    30720000  83  Linux

So I have 3 primary partitions at about 40gb, an extended partition (sda4) housing a logical partition (sda5) which is about 30gb.

However, when I look for details on each partition, I get an error message:

Code:

root@debian:/# fdisk -l /dev/sda1
Disk /dev/sda1: 41.9 GB, 41943040000 bytes
255 heads, 63 sectors/track, 5099 cylinders, total 81920000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/sda1 doesn't contain a valid partition table

The error message is the same for all the other partitions.
Can someone please advise what's gone wrong with these partitions?

EDDY1 01-06-2015 11:27 AM

fdisk doesn't work for 1 partition. Qlthough it does tell you the size of the partition. As far as "nvalid partition table" that's because you aren't scanning MBR.

Higgsboson 01-06-2015 11:53 AM

Quote:

Originally Posted by EDDY1 (Post 5296403)
fdisk doesn't work for 1 partition. Qlthough it does tell you the size of the partition. As far as "nvalid partition table" that's because you aren't scanning MBR.

I see. Thanks dude.

Incidentally, why does the first partition sda1 start with 2048?
I've seen some tutorials where the first partition starts at 1.

Head_on_a_Stick 01-06-2015 12:16 PM

Quote:

Originally Posted by Higgsboson (Post 5296436)
why does the first partition sda1 start with 2048?
I've seen some tutorials where the first partition starts at 1.

This is to allow correct alignment of the partitions which maximises drive performance.
http://www.thomas-krenn.com/en/wiki/Partition_Alignment

If you haven't done anything with the disk yet it may be worth converting it to a GPT type disk -- you won't have to use extended partitions (it allows 128 partitions as standard) and a backup copy of the partition table is stored at the end of the disk in case the main table is damaged. It will also make it easier to convert to EFI-mode booting at a later date (EFI-mode booting with MBR disks is firmware-dependent and may not work at all).

You can use gdisk to convert the partition table; just run `sudo gdisk /dev/sda` and it will offer to convert it.

EDIT: For use with non-EFI system you will also need to create a BIOS boot partition -- use gdisk again and create a new partition ("n") in sectors 34-2047 (this will be the default if the disk is full) and make it type "EF02" (no filesystem required).

EDDY1 01-06-2015 12:18 PM

The first 512 is usally MBR, but modified to 2048 to point to grub. Also 2048 allows for better partition allignment


All times are GMT -5. The time now is 12:58 PM.