[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [solved] Re: Change partition numbering



On Sat, 18 Apr 2015 17:07:10 +0000
Rodolfo Medina <rodolfo.medina@gmail.com> wrote:

> Rodolfo Medina <rodolfo.medina@gmail.com> writes:
> 
> > Hi all.
> >
> > After resizing a partition on my hard disk, partition numbering
> > changed and now number 7 comes before and number 6 comes after:
> >
> > Model: ATA SAMSUNG MP0402H (scsi)
> > Disk /dev/sda: 40.1GB
> > Sector size (logical/physical): 512B/512B
> > Partition Table: msdos
> > Disk Flags: 
> >
> > Number  Start   End     Size    Type      File system     Flags
> >  1      32.3kB  8390MB  8390MB  primary   fat32           boot
> >  2      8390MB  40.1GB  31.7GB  extended                  lba
> >  5      8390MB  9434MB  1045MB  logical   linux-swap(v1)
> >  7      9434MB  26.2GB  16.8GB  logical   ext3
> >  6      26.2GB  40.1GB  13.8GB  logical   ext3
> >
> > Is it possible, and how?, to correct that and change back 7 with
> > 6?  Googling around found no solution.
> 
> I found this article:
> 
>  http://unix.stackexchange.com/questions/18752/change-the-number-of-the-partition-from-sda1-to-sda2/18759#18759
> 
> According to it, I did:
> 
>  # sfdisk -d /dev/sda > myfile
> 
> and edited sda.bkp my way.  Then,
> 
>  # sfdisk --no-reread -f /dev/sda < myfile
> 
> .  Then I edited /etc/fstab properly and rebooted.  But then I had to
> rescue the system: from a Debian installation disk, in rescue mode,
> from the boot partition, I did:
> 
>  # grub-install /dev/sda
> 
> , then rebooted and now it seems ok.  Maybe I had to give the last
> command before rebooting the first time.
> 

I've done this in the past with fdisk, carefully noting the partition
start and end cylinders, then deleting the offending items from the
partition table and adding them back in the right order. Write the
table, edit /etc/fstab if necessary and reboot...

What happens next depends on exactly what's on the partitions, and
where the references to /dev/sda1, etc. are. I think there is only
likely to be trouble where grub is involved, as it stores actual disc
locations. Everything else is likely to refer to the mount points in
fstab, and if mounting is by UUID, presumably nothing needs to be done
even there.

-- 
Joe


Reply to: