PCLinuxOS-Forums
News: ...FLASH!!! ...New PCLinuxOS Testing board now open. Register today! Be an active contributor to the PCLinuxOS future! ... Read all about it now, on THIS forum!!!..
 
*
Welcome, Guest. Please login or register. May 27, 2012, 04:14:29 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: HD partitioning 101 help please (solved)  (Read 653 times)
MtnMan
Sr. Member
****
Offline Offline

Posts: 257

Aged to perfection


« on: January 02, 2011, 08:45:51 AM »

Before I go about fixing something that isn't broke, I am hoping that someone can help with a couple questions.  After reading through some posts about the fdisk it is my understanding that the start of a partition should be 1 click above the end of the previous partition - so I looked and mine
Quote
Disk /dev/sda: 319.9 GB, 319936615424 bytes
255 heads, 63 sectors/track, 38896 cylinders, total 624876202 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: 0x49ed49ec

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63    42299144    21149541    7  HPFS/NTFS
/dev/sda2   *    42299392   105209931    31455270   83  Linux
/dev/sda3       105211904   112551935     3670016   82  Linux swap / Solaris
/dev/sda4       112567455   624864239   256148392+   5  Extended
/dev/sda5       112567518   175461929    31447206   83  Linux
/dev/sda6       175461993   238372469    31455238+  83  Linux
/dev/sda7       238372533   624864239   193245853+  83  Linux
and panicked.

Breathing returned when used cylinders and got
Quote
Disk /dev/sda: 319.9 GB, 319936615424 bytes
255 heads, 63 sectors/track, 38896 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x49ed49ec

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        2633    21149541    7  HPFS/NTFS
/dev/sda2   *        2634        6550    31455270   83  Linux
/dev/sda3            6550        7007     3670016   82  Linux swap / Solaris
/dev/sda4            7008       38896   256148392+   5  Extended
/dev/sda5            7008       10922    31447206   83  Linux
/dev/sda6           10923       14838    31455238+  83  Linux
/dev/sda7           14839       38896   193245853+  83  Linux
I want to be sure that this overlap is something that I should fix - or is it not necessary.

Secondly, I would like to know why boot is stared on sda2 while my default boot is sda5.  If I choose boot option sda2(KDE) then I am presented with a list of boot options again with KDE as default.  Not a big problem but just doesn't seem right.  Is it supposed to do that?

Thanks in advance for any help/edification.
Logged

I worry that the person who thought up Muzak may be thinking up something else. - Lily Tomlin
Was_Just19
Hero Member
*****
Offline Offline

Posts: 6885


MLU


« Reply #1 on: January 02, 2011, 10:00:29 AM »

The partition marked as bootable is only in use when Windows controls the MBR .......  it has to be told which partition is bootable.
Grub does not use this, so it doesn't matter where it is in your present setup.
Logged
Old-Polack
Administrator
Hero Member
*****
Offline Offline

Posts: 9695


----IOFLU----


« Reply #2 on: January 02, 2011, 11:50:39 AM »

MountainMan:

Your /dev/sda2 and /dev/sda3 appear to have an overlap only because they don't end and start on cylinder boundaries. When looked at by sectors it can be seen there is no actual overlap, so there is no need for repair. In the future we'll be seeing more of this, as various partitioning tools use sectors rather than cylinders to set their boundaries. Don't worry about it. It's enough to be aware of the reality.

As Just19 points out, the bootable flag is meaningless to Linux and grub, and only a Windows thing. Still, it's easily set or unset with fdisk.

[root@fatman ~]# fdisk /dev/sda

WARNING: cylinders as display units are deprecated. Use command 'u' to
         change units to sectors.

Command (m for help): m
Command action
   a   toggle a bootable flag             <-- This command
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): a
Partition number (1-17): 1

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000d21c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          39      313236   83  Linux
/dev/sda2              40        1047     8096760   82  Linux swap / Solaris
/dev/sda3            1048        7127    48837600   83  Linux
/dev/sda4            7128      121601   919512405    5  Extended
/dev/sda5            7128       20500   107418591   83  Linux
/dev/sda6           20501       33267   102550896   83  Linux
/dev/sda7           33268       37158    31254426   83  Linux
/dev/sda8           37159       41049    31254426   83  Linux
/dev/sda9           41050       44940    31254426   83  Linux
/dev/sda10          44941       48831    31254426   83  Linux
/dev/sda11          48832       61886   104864256   83  Linux
/dev/sda12          61887      101050   314584798+  83  Linux
/dev/sda13         101051      104942    31262458+  83  Linux
/dev/sda14         104943      108893    31736376   83  Linux
/dev/sda15         108894      113071    33559753+  83  Linux
/dev/sda16         113072      121485    67584136+  83  Linux
/dev/sda17         121486      121601      931040+  83  Linux

Command (m for help): a
Partition number (1-17): 1

Command (m for help): p

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000d21c

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          39      313236   83  Linux
/dev/sda2              40        1047     8096760   82  Linux swap / Solaris
/dev/sda3            1048        7127    48837600   83  Linux
/dev/sda4            7128      121601   919512405    5  Extended
/dev/sda5            7128       20500   107418591   83  Linux
/dev/sda6           20501       33267   102550896   83  Linux
/dev/sda7           33268       37158    31254426   83  Linux
/dev/sda8           37159       41049    31254426   83  Linux
/dev/sda9           41050       44940    31254426   83  Linux
/dev/sda10          44941       48831    31254426   83  Linux
/dev/sda11          48832       61886   104864256   83  Linux
/dev/sda12          61887      101050   314584798+  83  Linux
/dev/sda13         101051      104942    31262458+  83  Linux
/dev/sda14         104943      108893    31736376   83  Linux
/dev/sda15         108894      113071    33559753+  83  Linux
/dev/sda16         113072      121485    67584136+  83  Linux
/dev/sda17         121486      121601      931040+  83  Linux

As I don't have Windows installed on any hard drives, I leave the bootable flag off of my partitions. If it makes you more comfortable, you can either set the flag to your /dev/sda1 or leave it off entirely. As long as you use grub to boot it won't make any difference. If you should remove grub as the boot loader, and return the MBR to Windows boot code, then you would need /dev/sda1 flagged as bootable for that code.



Logged

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...
MtnMan
Sr. Member
****
Offline Offline

Posts: 257

Aged to perfection


« Reply #3 on: January 02, 2011, 04:04:32 PM »

Just19 and old-polack thank you very much for the responses.  For exercise, I changed the boot flag to sda5 and indeed saw no difference;  though this was a little scary but makes sense -
Quote
Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
This statement
MountainMan:
If you should remove grub as the boot loader, and return the MBR to Windows boot code, then you would need /dev/sda1 flagged as bootable for that code.

begs a question (if I can pick your brain a little more): does that mean putting the flag at sda1 and deleting Linux partitions - Windows will still boot?  Many times in the past deleting/wrecking Linux partitions meant jumping through hoops in Windows to fix MBR etc. because it would not find MBR to boot.  I don't expect to be doing that again - just curious.
Logged

I worry that the person who thought up Muzak may be thinking up something else. - Lily Tomlin
Was_Just19
Hero Member
*****
Offline Offline

Posts: 6885


MLU


« Reply #4 on: January 02, 2011, 04:18:12 PM »


begs a question (if I can pick your brain a little more): does that mean putting the flag at sda1 and deleting Linux partitions - Windows will still boot?  Many times in the past deleting/wrecking Linux partitions meant jumping through hoops in Windows to fix MBR etc. because it would not find MBR to boot.  I don't expect to be doing that again - just curious.


If you delete the Linux partition, in which Grub has its files for booting then the PC will not boot .....  you will get a Grub error.
You would need to use the Win disk to 'fix the MBR' ......  revert it to the Win booting.
As I have no Win here I am unsure if you would have to change the boot flag yourself or if the Win disk would change it.

regards.
Logged
Old-Polack
Administrator
Hero Member
*****
Offline Offline

Posts: 9695


----IOFLU----


« Reply #5 on: January 02, 2011, 04:30:45 PM »

MountainMan:

If you put the boot flag on /dev/sda1 now, it will already be there if you should need to restore the MBR to using Windows boot code.

The proper way to remove a Linux OS from a system with only one hard drive, dual booting with Windows, is to run fixmbr from the recovery console or a recovery CD, first, insure that Windows now boots properly, and only when it does, then remove the Linux partitions. Removing the Linux partitions first just leaves the system unbootable.
Logged

Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...
MtnMan
Sr. Member
****
Offline Offline

Posts: 257

Aged to perfection


« Reply #6 on: January 02, 2011, 05:20:35 PM »

Just19 and old-polack thank you very much for that response - had to dip into the winderz recovery console many times in the early days of trying Linux - just wondered if there was something as simple as moving a flag that would have avoided it.  Thanks again and have a great year.
Logged

I worry that the person who thought up Muzak may be thinking up something else. - Lily Tomlin
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM