DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD Installation and Upgrading

NetBSD Installation and Upgrading Have trouble getting NetBSD on your toaster?

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th February 2009
fbsduser fbsduser is offline
Shell Scout
 
Join Date: Aug 2008
Posts: 110
Default Moving linux partitions out of the BSD disklabel/slice

Hi. Sorry for being away but my Toshiba laptop passed away due to a nasty power surge while it was hooked on the AC. Luckily yesterday a rich kid a few houses below my block dumped a perfectly new and functional Acer laptop because "it was getting slow (read: windoze rot)" and I took it and decided to install NetBSD 4.0 (I have a mini-cd with it) along with Ubuntu Ultimate 2.0 (I also have it's LiveDVD, didn't chose sabayon because it's disc was in the toshiba's drive when the "incident" happened and the disc was unrecoverably damaged as well) in a dualboot setup, but after installing NetBSD (easy stuff) I realized that the partitioner that comes in the Ubuntu Ultimate installer (and gparted too) cannot notice the BSD partition (my HD is currently laid out in this way)
as seen in linux cfdisk:
Code:
                           cfdisk (util-linux-ng 2.14)

                              Disk Drive: /dev/sda
                       Size: 120034123776 bytes, 120.0 GB
             Heads: 255   Sectors per Track: 63   Cylinders: 14593

    Name        Flags      Part Type  FS Type          [Label]         Size (MB)

------------------------------------------------------------------------------
    sda1        Boot        Primary   NetBSD                             12000.69
    sda2                       Primary   NTFS                                 85929.51
    sda5        NC          Logical   Linux ext3      [Almacenaje]   20003.89
                                 Logical   Free Space                                  0.04*
    sda4                      Primary   Linux swap / Solaris               2097.42*





     [ Bootable ]  [  Delete  ]  [   Help   ]  [ Maximize ]  [  Print  ]
     [   Quit   ]  [   Type   ]  [  Units   ]  [  Write   ]
as seen in linux fdisk
Code:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1459    11719386   a9  NetBSD
/dev/sda2            1460       11906    83915527+   7  HPFS/NTFS
/dev/sda3           11907       14593    21583327+   f  W95 Ext'd (LBA)
/dev/sda4           14339       14593     2048256   82 Linux swap / Solaris
/dev/sda5           11907       14338    19534977   83  Linux
and as seen in NetBSD fdisk
Code:
Disk: /dev/rwd0d
NetBSD disklabel disk geometry:
cylinders: 232581, heads: 16, sectors/track: 63 (1008 sectors/cylinder)
total sectors: 234441648

BIOS disk geometry:
cylinders: 1023, heads: 255, sectors/track: 63 (16065 sectors/cylinder)
total sectors: 234441648

Partition table:
0: NetBSD (sysid 169)
    start 63, size 23438772 (11445 MB, Cyls 0-1458), Active
1: NTFS, OS/2 HPFS, QNX2 or Advanced UNIX (sysid 7)
    start 23438835, size 167831055 (81949 MB, Cyls 1459-11905)
2: Ext. partition - LBA (sysid 15)
    start 191269890, size 43166655 (21077 MB, Cyls 11906-14592)
3: Linux swap or Prime or Solaris (sysid 130)
    start 230340033, size 4096512 (2000 MB, Cyls 14338/1/1-14592)
        PBR is not bootable: All bytes are identical (0x00)
Extended partition table:
E0: Linux native (sysid 131)
    start 191270016, size 39069954 (19077 MB, Cyls 11906/2/1-14337)
        PBR is not bootable: All bytes are identical (0x00)
what I want to do is make the partition table become visible to gparted and the installer's partition manager without having to lose the contents of the sda5 partition, so that I can install Ubuntu without losing the files in that partition and without removing the already installed NetBSD. The question would be then. Is it possible to somehow resize the BSD slice and move sda2, sda3, sda4 and sda5 out of the BSD slice or make Ubuntu recognize the BSD style disklabel and install on sda2 (that partition will become the Ubuntu's "/" one)? If there is a way, how (with which tool/under which OS)? or if it's imposible and using an external HD (to save the contents of sda5) is the only way out, how do I install NetBSD so that Ubuntu will be installable after installing NetBSD?
Reply With Quote
  #2   (View Single Post)  
Old 28th February 2009
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,167
Default

I am afraid it will be rather difficult to do what you want

A standard MBR only can accomodate 4 slices (1-4, or 0-3). An extended slice/partition is a way to circumvent the 4 slice limit, it just acts as a container for one or more multiple logical subpartitions or slices.
A MBR can only have one single extended partition, optionally in combination with 1 to 3 primary slices/partitions.

You have 3 primary partitions:
  • partition 0: Netbsd
  • partition 1: NTFS
  • partition 3: Linux swap
The second slot of the MBR is occupied with an extended partition, containing one logical partition, the Linux/Ubuntu native partition.

If you have a thorough detailed knowledge of the MBR and the partition conventions, you could attempt a conversion of the logical Linux/Ubuntu partition into a primary partition. But even then partition boot record (PBR) issue could prevent you from using it. This PBR issue could also affect you if you backup the current Ubuntu install.

The simplest way, for a more simple layout would be to remove the extended partition, and it's single logical one. Then create a primary Linux partition and reinstall Ubuntu, hoping it will accept your freshly created primary Linux native partition. But that means to goodbye to your Linux/Ubuntu data.

Both gparted and the Ubuntu installer probably have trouble with the NetBSD partition because of a lack of understanding of the NetBSD disklabel.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #3   (View Single Post)  
Old 28th February 2009
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by fbsduser
... move sda2, sda3, sda4 and sda5 out of the BSD slice ...
I'm confused by this. Looking at the Linux fdisk output, the BSD slice goes from 1 to 1459. All of the other partitions come after this slice, don't they?

And there is another odd thing in the setup. The final primary partition (sda4 = Linux swap) actually lies within the region delineated by the extended partition, i.e., 14339 to 14593 lies within 11907 to 14593. This seems unconventional and might be confusing gparted? -- that's just a guess, I've never used gparted.

Also you suggested using the sda2 partition to install Ubunto / ... if you have no valuable data on this HPFS/NTFS partition, you could I suppose try to change the partition type to 83 = Linux native with Linux' fdisk (possibly make a Linux fs on there too), and see if you can install on there?

These are all just things to think about, as I'm not 100% sure what you want to do.
Reply With Quote
  #4   (View Single Post)  
Old 28th February 2009
fbsduser fbsduser is offline
Shell Scout
 
Join Date: Aug 2008
Posts: 110
Default

Changed the sda2 file type from cfdisk and did a mkfs.ext3, didn't fix it. Also I do have the swap inside an extended partition, but I never had issues because of that (I have been doing it before and neither gparted nor the partitioner inside ubuntu's installer had complained about that before.
About the contents of sda5. I finally got myself a HDD case and a 3.5" 80GB HD I had lying around from a long dead desktop PC and made myself an external HD, so my data is now in the external. Basically what I want to do is to do a dualboot (the external is for storage only, since this PC doesn't seem able to boot off USB) between NetBSD and Ubuntu, but installing netbsd first so that I can use grub as the bootloader instead of the NetBSD one.

Last edited by fbsduser; 28th February 2009 at 10:25 PM.
Reply With Quote
  #5   (View Single Post)  
Old 28th February 2009
IdOp's Avatar
IdOp IdOp is offline
Too dumb for a smartphone
 
Join Date: May 2008
Location: twisting on the daemon's fork(2)
Posts: 1,027
Default

Quote:
Originally Posted by fbsduser View Post
Changed the sda2 file type from cfdisk and did a mkfs.ext3, didn't fix it.
That's too bad but was worth a quick try I guess. I still think the problem might be from the next point though:
Quote:
Also I do have the swap inside an extended partition, but I never had issues because of that (I have been doing it before and neither gparted nor the partitioner inside ubuntu's installer had complained about that before.
Yes, I also have my Linux swap inside an extended partion. However, what I have there is a logical sub-partition inside the extended partition. This would be a partition numbered 5 or higher by Linux (say, sdaN where N >= 5). But what your fdisk output shows is a primary partition (sda4, note: 4<5) rather than a logical sub-partition of the extended partition. Your sda4 occupies an area inside the region bounded by the extended partition. This overlap seems odd enough to me that it *might* cause a partition editor to be confused.

Quote:
About the contents of sda5. I finally got myself a HDD case and a 3.5" 80GB HD I had lying around from a long dead desktop PC and made myself an external HD, so my data is now in the external. Basically what I want to do is to do a dualboot (the external is for storage only, since this PC doesn't seem able to boot off USB) between NetBSD and Ubuntu, but installing netbsd first so that I can use grub as the bootloader instead of the NetBSD one.
Perhaps with your Linux data backed up you can try J65nko's suggestion to remove the extended partion, then create either a new primary or a new extended partition with a single logical sub-partition occupying all its space (and not overlapping your swap area), and restore your Linux data on there. Maybe you could even use this as /usr or /home with / (root) on the ext3 sda2 you made? (Once the overlap problem is gone, assuming that's the problem.)

Last edited by IdOp; 28th February 2009 at 11:28 PM.
Reply With Quote
  #6   (View Single Post)  
Old 4th March 2009
fbsduser fbsduser is offline
Shell Scout
 
Join Date: Aug 2008
Posts: 110
Default

The good news is that I figured out how to get myself out of the mess (I'm posting from Ubuntu Ultimate 2.0 x64). It turns out that I just needed to answer "no" to the part where it asks to put the latest BSD mbr.

BTW: I just dist-upgraded to jaunty alpha and I can tell, it's incredible cool, rock-solid and stable for a dumbed down distro.

Last edited by fbsduser; 4th March 2009 at 07:10 AM.
Reply With Quote
Reply

Tags
disklabel, linux, linux after bsd., netbsd

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disklabel problem sateenkaari NetBSD Installation and Upgrading 3 13th August 2009 02:51 AM
Moving to ZFS Business_woman FreeBSD General 6 20th October 2008 03:28 PM
disklabel don't see OpenBSD partition piotrk OpenBSD General 4 25th September 2008 06:14 PM
Moving ZFS partitions/drives between systems corey_james Guides 2 6th August 2008 08:36 PM
Change the Size of a Slice kienjakenobi FreeBSD General 9 27th June 2008 03:01 PM


All times are GMT. The time now is 07:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick