[HowTo] Swap, Linux Partition, Windows Partition

Post tutorials, HOWTO's and other useful resources here.
User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

[HowTo] Swap, Linux Partition, Windows Partition

Post#1 by Rava » 15 Oct 2015, 04:45

Hi,

here my small [HowTo] for creating, especially for older, slower hardware, these partitions in this order: Linux Swap , Linux Partition (ext3), Windows Partition (ntfs)

Since currently the only XP professional Volume Licence version we have here is XP SP3.
Yes, I know Witless XP is no longer maintained by Micro$oft. There are no longer security updates. But I never go online with any of my Witless OS anyway. So, I recommend, at least when you follow this howto install Linux (Porteus) and Witless XP, when running Witless XPdo as I do: always plug out the network cable, and disable any WLAN capabilities of your PC or notebook.


So, let's start.

Start up your PC with any Live Linux that has fdisk or GParted installed. I used Porteus (I tweak all my Porteus version so that it always boots into virtual terminal aka text mode, and I have to startx manually, if I need it. In this case, X is not needed, since I used fdisk.

Start as root

Code: Select all

fdisk /dev/sda
Make sure that the hard disk you want to partition is indeed /dev/sda. Be aware that all data on this hard disk will be lost.

Create the swap partition as first partition. Why as first? Because usually the starting sectors of a hard disk are quicker to be read and written, and it gets slower the more the data is onto the end part of a hard disk. This is not true for SolidStateDisks, but then you won't follow this HowTo, since I presume you don't have old slow hardware anyway, why put a SSD into such an old machine?

Code: Select all

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-78165359, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-78165359, default 78165359): +2G
Partition 1 of type Linux and of size 2 GiB is set

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 82
Changed system type of partition 1 to 82 (Linux swap)
Create the Linux Partition

Code: Select all

Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): p
Partition number (1-4, default 2):
Using default value 2
First sector (4196352-78165359, default 4196352):
Using default value 4196352
Last sector, +sectors or +size{K,M,G} (4196352-78165359, default 78165359): +4G
Partition 2 of type Linux and of size 4 GiB is set
Now create the ntfs partition, we use the rest of the hard disk for this. Doing so the free space can be used by both Linux and WitlessOS. But be aware that Linux will work slower since it needs to access ntfs, and there are no native ntfs drivers for Linux, all we have is reverse engineered drivers cause Micro$oft never made the specifications of ntfs public. Though bugs were found by the reverse engineering, but at least for XP, Micro$oft never bothered to remove that bug.

Code: Select all

Command (m for help): n
Partition type:
   p   primary (2 primary, 0 extended, 2 free)
   e   extended
Select (default p): p
Partition number (1-4, default 3):
Using default value 3
First sector (12584960-78165359, default 12584960):
Using default value 12584960
Last sector, +sectors or +size{K,M,G} (12584960-78165359, default 78165359):
Using default value 78165359
Partition 3 of type Linux and of size 31.3 GiB is set

Command (m for help): t
Partition number (1-4): 3
Hex code (type L to list codes): 7
Changed system type of partition 3 to 7 (HPFS/NTFS/exFAT)
Now, let's look what we have:

Code: Select all

Command (m for help): p

Disk /dev/sda: 40.0 GB, 40020664320 bytes
54 heads, 48 sectors/track, 30156 cylinders, total 78165360 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: 0x01a90f44

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048     4196351     2097152   82  Linux swap
/dev/sda2         4196352    12584959     4194304   83  Linux
/dev/sda3        12584960    78165359    32790200    7  HPFS/NTFS/exFAT
If all is as it should be, write the partition tables with command w.

Exit fdisk with q.

Create the swap partition with

Code: Select all

mkswap /dev/sda1
Create the ext3 partition with

Code: Select all

mkfs.ext3 /dev/sda2
Create the ntfs partition with

Code: Select all

mkfs.ntfs -Q /dev/sda3
Why the quick partition? Let's better assume your hard disk has no bad blocks, and when doing a regular mkntfs, it would fill the complete partition with zeroes. Which will erase all previous stored data. But it's not necessary (unless security reasons say so, in that case do not do a quick partition) and take a lot of time.
But you are the one to decide here. Do you have private or confidential data on your old hard disk? If so, don't use the -Q option.

Now, copy your Porteus boot and Porteus folders to sda2, but you also can do that at the very end.

Now, insert your WitlessXP installation CD and restart your PC, make sure to tell it to Boot from CDROM.

Make sure to tell XP to not touch the 1st and 2nd "unknown partition" it lists, it will tell you that your created sda3 is its C: partition. Use that partition to install XP on. You can either keep the partition as it is, or make a quick format.

After 2 or 3 reboots XP is finally installed. Use your Live Linux by either booting from an USB pendrive or a CDROM and install your Linux to sdb2, when you haven't done so already as written above.

Now, when it's Porteus, go into sda2/boot and run as root Porteus-installer-for-Linux.sh

Edit your porteus.cfg to be able to boot XP as well by adding this entry:

Code: Select all

LABEL W-XP
MENU LABEL W-Xp from intHDE0,3
COM32 chain.c32
APPEND hd0 3
TEXT HELP
    Start W-XP from intHDE 0,3
ENDTEXT
Start your PC. make sure to boot from your hard disk. Try booting Porteus, and try booting Witless-XP. All should boot well, even when technically XP is not installed on the 1st or 2nd partition.

Have a nice day.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Re: [HowTo] Swap, Linux Partition, Windows Partition

Post#2 by Ed_P » 15 Oct 2015, 14:08

Rava wrote:Create the ntfs partition with

Code: Select all

mkfs.ntfs -Q /dev/sda2
Are you sure you don't mean:

Code: Select all

mkfs.ntfs -Q /dev/sda3
_ _ _ _ _ _ _ _ _ _ _ _ _ _ ^

:)
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Re: [HowTo] Swap, Linux Partition, Windows Partition

Post#3 by Rava » 16 Oct 2015, 14:24

^
I could be an ***hole and say that I put this mistake in by purpose to see if anyone really reads it thoroughly... but yeah, you are right, it was indeed a mistake. Image

And I typed the stuff really into fdisk, with my current running system with lots of non backup'd data (reminds me of doing a backup... :D ), but without typing the [w][enter] at the end, of course...

___________________________________________

And anyone who tries the above, or a variation, like creating 4 partitions, Linux Swap, Linux FS (ext3, ext4, reiser, whatever), ntfs & jet another ntfs, or such, please comment in here if it works like it should with any other WitlessOS version than XP.

The only newer version I have is 7, and that's complicated by itself, with the hidden 1st and hidden last partition that you only see when booting Linux or BSD, but never see as WitlessOS user.

I just used gparted to re-partition the hard disk adding a Linux one, and adding a data ntfs one separated from Witless7 OS C: partition) and used grup4dos for the boot loader, but I have 2 boot prompts, the 1st is the WitlessOS one, where the default setting is Linux, and then the Linux one with grub with the variants I choose to have on this machine, which is, of course, Porteus and some Puppy variant.
Dunno about Vista; I presume Witless 8 & 10 are the same when it comes to such hidden partitions...
Cheers!
Yours Rava

Post Reply