You are not logged in.

#1 2010-11-26 20:24:28

jocheem67
Member
Registered: 2009-11-09
Posts: 243

sda3 to sda1 ---- sda4 to sda2 [Solved]

After install probs with win7 , which resided on my first partition of my HD, I for now just ditched win7.
Used gparted  to convert my sda1 to ext4 and let Arch just fill up my entire drive. Result is using a higher number of drives.

This doesn't seem to be a problem though, just changed my menu.lst to point grub to the right partition numbers. Fstab uses UUID's..

It's messy though...

I tried to use fdisk to correct the issue, but to no avail. And it's a bit dangerous.

Can anyone tell me if there's a need to correct this? Up 'till now everything seems stable.

Are there easier ways than the rather cryptic fdisk to correct this 'all??

Thanks in advance.

Last edited by jocheem67 (2010-12-02 06:49:40)

Offline

#2 2010-11-27 05:37:06

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,774

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

Sorry, I am not grasping your problem.

Can you post the output of:
cat /etc/fstab
mount

and
sudo fdisk -l /dev/sda


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2010-11-27 23:50:50

jocheem67
Member
Registered: 2009-11-09
Posts: 243

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

I will reply later with the requested conf's..I've got no access to the box in question now.....tomorrow I will..

Thanks.

Offline

#4 2010-11-28 04:11:16

neotuli
Lazy Developer
From: London, UK
Registered: 2004-07-06
Posts: 1,204
Website

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

Just to give you some background... UUIDs are used because on a lot of hardware the order of partitions and disks might change at boot time randomly. So sda might suddently be sdb and vice versa. Also, the partition's UUID will change if you reformat it.


The suggestion box only accepts patches.

Offline

#5 2010-11-29 15:50:59

jocheem67
Member
Registered: 2009-11-09
Posts: 243

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

cat /etc/fstab

UUID="54c9145b-1176-40a6-84bb-505df52a654a"  / ext4 defaults,noatime 0 1
UUID="5561ccbb-a3f9-4420-b548-72b9b436fa03"  swap swap defaults  0 0
UUID="32DCB0F4DCB0B407" /media/Backup  ntfs-3g uid=1000,fmask=0077,dmask=0077,noatime 0 0

fdisk

Schijf /dev/sda: 1000.2 GB, 1000204886016 bytes
255 koppen, 63 sectoren/spoor, 121601 cilinders, totaal 1953525168 sectoren
Eenheid = sectoren van 1 * 512 = 512 bytes

Sectorgrootte (logischl/fysiek): 512 bytes / 512 bytes
in-/uitvoergrootte (minimaal/optimaal): 512 bytes / 512 bytes
Schijf-ID: 0x00064473

Apparaat Opstart   Begin       Einde     Blokken   ID  Systeem
/dev/sda3            2048  1948395329   974196641   83  Linux
/dev/sda4      1948395330  1953520064     2562367+  82  Linux wisselgeheugen

mount

proc on /proc type proc (rw,relatime)
sys on /sys type sysfs (rw,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=10240k,nr_inodes=498179,mode=755)
/dev/disk/by-uuid/54c9145b-1176-40a6-84bb-505df52a654a on / type ext4 (rw,noatime,commit=0)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
devpts on /dev/pts type devpts (rw)
shm on /dev/shm type tmpfs (rw,nosuid,nodev)
/dev/sdb1 on /media/Backup type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096,default_permissions)
gvfs-fuse-daemon on /home/jochem/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=jochem)

As far as I'm concerned the issue here is the /dev/sda3 and 4...should be /dev/sda1 and 2.
So the question is here how to change that?

I know about fdisk being capable writing some new partition-tables. I's a pretty dangeroes action I guess.

Probably just need some reassurance here, or if around a fail-safe method, kind of...:)

Thanks!

Last edited by jocheem67 (2010-11-29 15:51:41)

Offline

#6 2010-11-29 17:59:04

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

Actually, fdisk is the easiest way to rewrite the partition table.  I just tried it here and had no problems.  Of course, I had complete backups on hand for the two partitions I wanted to rename and /dev/sda was unmounted.

Reordering partitions /dev/sda7 and /dev/sda8:

# fdisk /dev/sda

Command (m for help): m
Command action
   a   toggle a bootable flag
  ...
   p   print the partition table
  ...
   w   write table to disk and exit
   x   extra functionality (experts only)

Command (m for help): p

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x0003c7ca

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845     4401809     2096482+  82  Linux swap / Solaris
/dev/sda3         4401810   625137344   310367767+   5  Extended
/dev/sda5         4401936    46347524    20972794+  83  Linux
/dev/sda6        46347588    54733454     4192933+  83  Linux
/dev/sda7       551731200   625135615    36702208    7  HPFS/NTFS
/dev/sda8        54733518   551729151   248497817   83  Linux

Partition table entries are not in disk order

Command (m for help): x

Expert command (m for help): m
Command action
   b   move beginning of data in a partition
  ...
   f   fix partition order
  ...
   w   write table to disk and exit

Expert command (m for help): f
Done.

Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

Now:

$ sudo fdisk -l /dev/sda
Password: 

Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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: 0x0003c7ca

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *          63      208844      104391   83  Linux
/dev/sda2          208845     4401809     2096482+  82  Linux swap / Solaris
/dev/sda3         4401810   625137344   310367767+   5  Extended
/dev/sda5         4401936    46347524    20972794+  83  Linux
/dev/sda6        46347588    54733454     4192933+  83  Linux
/dev/sda7        54733518   551729151   248497817   83  Linux
/dev/sda8       551731200   625135615    36702208    7  HPFS/NTFS

No problem.  UUIDs and labels remained intact.

Offline

#7 2010-11-30 15:47:35

jocheem67
Member
Registered: 2009-11-09
Posts: 243

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

The problem persists:
fdisk states that the partitiontable is already in order.

Furthermore, I've got trouble to pin down the right way to ' fix ' the sectors.

I've got little time on this box, so in a couple of days I will take screenshots of the various fdisk stages ( should I take pictures or is there a command for taking screenshots when on the Arch livecd??? )

Will report back, when more time. Thanks guys for the effort already smile

Offline

#8 2010-11-30 15:56:26

Ramses de Norre
Member
From: Leuven - Belgium
Registered: 2007-03-27
Posts: 1,289

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

Just set up labels and use those, they are easy, clean and persistent. Search the wiki for more info.

Offline

#9 2010-12-01 12:57:46

jocheem67
Member
Registered: 2009-11-09
Posts: 243

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

I'm using UUID's so there is technically speaking no problem, right?? That's why I'm calling it an issue ( which seems a better word here. English is my third language, so the finesses are not always right....:) )

What I did was using clonezilla to mirror my /dev/sda3, I could put that one back after a gparted treatment, right?

Offline

#10 2010-12-01 16:01:53

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

Rerun the grub setup and it should solve the problem. Google on how to recover grub after installing windows, the procedure is the same.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#11 2010-12-02 06:47:51

jocheem67
Member
Registered: 2009-11-09
Posts: 243

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

I'm going to mark this as solved. I put back an image with no problem.

The fdisk issue remains a bit funny though....

Thanks all.

Offline

#12 2011-01-03 19:36:01

snaz
Member
Registered: 2010-10-15
Posts: 14

Re: sda3 to sda1 ---- sda4 to sda2 [Solved]

Mmk, I found a way to "fix" it, although I'm sure there's a better way.

My partition scheme looked like this:

Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes
255 heads, 63 sectors/track, 182401 cylinders, total 2930277168 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: 0x109db662

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb2            4096  2618867711  1309431808    7  HPFS/NTFS
/dev/sdb3   *  2618868105  2930272064   155701980   af  HFS / HFS+

What I did was, in gparted, create a new partition a the end of the disk. That partition was given the designation /dev/sdb1. Then I went through thisoldman's procedure to fix the partition numbers. Which I purposely broke in the first place.

Long story short, my partition numbers were fixed by fdisk, at which point I deleted the temporary partition I had created at the end of the disk.

Offline

Board footer

Powered by FluxBB