Choose style:

Author Topic: Wrong partition ID on /DATA partition [SOLVED]  (Read 2718 times)

0 Members and 1 Guest are viewing this topic.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Wrong partition ID on /DATA partition [SOLVED]
« on: February 08, 2016, 06:16:09 pm »
Hi, this question is caused by my clumsiness.  I've been setting up a triple boot system using Peppermint Six as my prime OS and Xubuntu 15.10, and BunsenLabs Hydrogen as secondary installations.  The installations are split over two disks.  The /boot, / and /home partitions are on 128GB SSD.  The /mnt/DATA and SWAP partitions are on a 160GB HDD.  See fdisk -l and blkid below.

andy@andy-Latitude-E6410 ~ $ sudo fdisk -l
[sudo] password for andy:

Spoiler (click here to view / hide)
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0x00052687

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4094   215650303   107823105    5  Extended
/dev/sda5            4096      822455      409180   83  Linux
/dev/sda6          825344    44865535    22020096   83  Linux
/dev/sda7        44867584    71606271    13369344   83  Linux
/dev/sda8        71608320    72426679      409180   83  Linux
/dev/sda9        72429568   116469759    22020096   83  Linux
/dev/sda10      116471808   143210495    13369344   83  Linux
/dev/sda11      143212544   187252735    22020096   83  Linux
/dev/sda12      187254784   215650303    14197760   83  Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x000ed665

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   295804927   147901440   82  Linux swap / Solaris
/dev/sdb2       295804928   312580095     8387584   82  Linux swap / Solaris
andy@andy-Latitude-E6410 ~ $
[close]


andy@andy-Latitude-E6410 ~ $ sudo blkid
Spoiler (click here to view / hide)
/dev/sda5: LABEL="/boot" UUID="693ded13-9239-485f-aa0d-4bfbe1585366" TYPE="ext4"
/dev/sda6: UUID="e2f6f268-149c-4f4b-85c2-996903da7432" TYPE="ext4"
/dev/sda7: LABEL="/home" UUID="ae8dce93-2d05-4c66-acec-3788d7fb916e" TYPE="ext4"
/dev/sda8: LABEL="/boot2" UUID="42f4a541-3055-487b-90db-475c7e7b883c" TYPE="ext4"
/dev/sda9: LABEL="/root2" UUID="494b742b-6a28-4feb-9521-ae058000bdba" TYPE="ext4"
/dev/sda10: LABEL="/home2" UUID="5c1d2516-5848-4f59-94ab-a4a8caae655a" TYPE="ext4"
/dev/sda11: LABEL="/BL" UUID="81efc854-4e53-48bd-a1d3-ef406b5566f3" TYPE="ext4"
/dev/sda12: LABEL="/BLhome" UUID="4353fbcc-99ae-42d7-ad84-ad6b132f3ff6" TYPE="ext4"
/dev/sdb1: LABEL="/DATA" UUID="d4f5e84d-dbab-44ae-877d-f8b1777c3332" TYPE="ext4"
/dev/sdb2: UUID="a5383730-3bf3-42c7-a04f-b5c775aa9b1d" TYPE="swap"
andy@andy-Latitude-E6410 ~ $ sudo
[close]


The problem is with the SWAP and /mnt/DATA partitions.  While installing the BunsenLabs distro, I inadvertently selected the partition: /dev/sdb1 as SWAP.  It was deselected and set to, Do Not Use before the partition table was set.  It appears the the partition ID was changed from 82 to 83.  As you can see from fdisk -l, both partitions: /dev/sdb1 and /dev/sdb2 are now allocated to: Linux swap / Solaris.  This is not true according to blkid.  The partition, /dev/sdb1 should be ext4  This messed  up the UUID on the true SWAP partition, causing errors when Peppermint Six booted up.  This has been fixed in fstab and the errors have ceased.  The partition, /dev/sdb1 still has the wrong ID.  I know how to fix this the hard way.  Is there a way of doing this repair that doesn't involve removing the data from the /mnt/DATA partition and reformatting the disk?  Many thanks in advance  ;).
« Last Edit: February 08, 2016, 07:47:39 pm by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition
« Reply #1 on: February 08, 2016, 06:53:20 pm »
What's the output from
Code: [Select]
sudo sfdisk --print-id /dev/sdb 1

[EDIT]

Theoretically (I've never tried it), you can use fdisk:
http://www.labtestproject.com/using_linux/step_by_step_change_linux_partition_system_id_on_fedora_system
or sfdisk:
http://linux.die.net/man/8/sfdisk
with something like:
Code: [Select]
sudo sfdisk --change-id /dev/sdb 1 83
but don't blame me if it goes horribly wrong ;)

Personally I'd test it on say a USB stick first .. let's say  the USB stick is formatted as EXT4 (id = 83) and is at /dev/sdc1 .. then try
Code: [Select]
sudo sfdisk --change-id /dev/sdc 1 82
and check to see if the id type changed to 82 with
Code: [Select]
sudo sfdisk --print-id /dev/sdb 1
and if it did change to type 82, try changing it back with
Code: [Select]
sudo sfdisk --change-id /dev/sdc 1 83
and check it's type again.
« Last Edit: February 08, 2016, 07:10:09 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition
« Reply #2 on: February 08, 2016, 06:59:56 pm »
What's the output from
Code: [Select]
sudo sfdisk --print-id /dev/sdb 1

Here's the requested output:
Code: [Select]
andy@andy-Latitude-E6410 ~ $ sudo sfdisk --print-id /dev/sdb 1
[sudo] password for andy:
82
andy@andy-Latitude-E6410 ~ $
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition
« Reply #3 on: February 08, 2016, 07:05:12 pm »
See the [EDIT] in my last posting Andy ;)
Code: [Select]
sudo sfdisk --change-id /dev/sdb 1 83
should do the trick, but I'd test it on a USB stick as mentioned in my last posting) first if I were you ;)
« Last Edit: February 08, 2016, 07:08:37 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition
« Reply #4 on: February 08, 2016, 07:17:15 pm »
see the [EDIT] above Andy ;)
Code: [Select]
sudo sfdisk --change-id /dev/sdb 1 83
should do the trick, but I'd test it on a USB stick first if I were you
Sorry about that, I've just seen your edit  ;).  Yeah, I'll give that whirl in the morning.  If it works, that's great and we have something new for the knowledge base.  If it doesn't, I get to practice installing multiple distros again  ;D.  Incidentally, the former Crunchbang community have done a bang up job with BunsenLab Hydrogen.  It still makes Openbox a very cool and slick way of using Debian - thanks for the help   ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition
« Reply #5 on: February 08, 2016, 07:27:14 pm »
I'm fairly confident it's safe, but I don't like telling other people to do anythng that might risk data loss unless I've tested the command myself.

Problem is neither fdisk or sfdisk support GPT partition tables so currently I can't test it.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition
« Reply #6 on: February 08, 2016, 07:33:50 pm »
I'm fairly confident it's safe, but I don't like telling other people to do anythng that might risk data loss unless I've tested the command myself.

Problem is neither fdisk or sfdisk support GPT partition tables so currently I can't test it.
I'll bung some data on the thumb drive before I run the test.  That way, we'll know if the data remains untouched  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition
« Reply #7 on: February 08, 2016, 07:35:28 pm »
I just tested it on a USB stick and it worked perfectly without data loss
Code: [Select]
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     7806975     3902464   83  Linux
mark@Silver-HP ~ $ sudo sfdisk --print-id /dev/sdb 1
83
mark@Silver-HP ~ $ sudo sfdisk --change-id /dev/sdb 1 82
Done

mark@Silver-HP ~ $ sudo sfdisk --print-id /dev/sdb 1
82
mark@Silver-HP ~ $ sudo sfdisk --change-id /dev/sdb 1 83
Done

mark@Silver-HP ~ $ sudo sfdisk --print-id /dev/sdb 1
83
In fact I was  even able to change it to type "7" (NTFS) and back to "83" again without data loss.
« Last Edit: February 08, 2016, 07:41:01 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition
« Reply #8 on: February 08, 2016, 07:40:24 pm »
I just tested it on a USB stick and it worked perfectly without data loss
Code: [Select]
   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     7806975     3902464   83  Linux
mark@Silver-HP ~ $ sudo sfdisk --print-id /dev/sdb 1
83
mark@Silver-HP ~ $ sudo sfdisk --change-id /dev/sdb 1 82
Done

mark@Silver-HP ~ $ sudo sfdisk --print-id /dev/sdb 1
82
mark@Silver-HP ~ $ sudo sfdisk --change-id /dev/sdb 1 83
Done

mark@Silver-HP ~ $ sudo sfdisk --print-id /dev/sdb 1
83
In fact you can even change it to "7" (NTFS) and back again without data loss.
Cool, I'll let you know what happens here in a minute or so  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition
« Reply #9 on: February 08, 2016, 07:46:14 pm »
Yeah, that did the trick, no data loss either.
Code: [Select]
andy@andy-Latitude-E6410 ~ $ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0x00052687

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        4094   215650303   107823105    5  Extended
/dev/sda5            4096      822455      409180   83  Linux
/dev/sda6          825344    44865535    22020096   83  Linux
/dev/sda7        44867584    71606271    13369344   83  Linux
/dev/sda8        71608320    72426679      409180   83  Linux
/dev/sda9        72429568   116469759    22020096   83  Linux
/dev/sda10      116471808   143210495    13369344   83  Linux
/dev/sda11      143212544   187252735    22020096   83  Linux
/dev/sda12      187254784   215650303    14197760   83  Linux

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 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: 0x000ed665

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   295804927   147901440   83  Linux
/dev/sdb2       295804928   312580095     8387584   82  Linux swap / Solaris
andy@andy-Latitude-E6410 ~ $ cd /mnt/DATA
andy@andy-Latitude-E6410 /mnt/DATA $ ls
AudioBooks  Clementine  Documents  Downloads  lost+found  Music  Pictures  Podcasts  Steam  Videos
andy@andy-Latitude-E6410 /mnt/DATA $
This is a very cool trick to know - thank again  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition
« Reply #10 on: February 08, 2016, 07:47:12 pm »
Any time Andy  :)
« Last Edit: February 08, 2016, 08:02:31 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition [SOLVED]
« Reply #11 on: February 08, 2016, 07:57:32 pm »
BTW, that's not actually changing the file system type (which was always EXT4), just the ID .. think of it as just a label of the type.
« Last Edit: February 08, 2016, 08:05:33 pm by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition [SOLVED]
« Reply #12 on: February 08, 2016, 08:42:33 pm »
BTW, that's not actually changing the file system type (which was always EXT4), just the ID .. think of it as just a label of the type.
I figured it must be that.  It was really annoying because it shouldn't have happened.  The partition table wasn't set.  It was still in setup and edit mode.  At least the fix is really simple and safe.  Saying that, the Debian GUI Installer is very easy to follow.  It's just not as pretty as Ubiquity.  The text based installer is also very easy too.  The post installation setup scripts that the BunsenLabs team have developed from Crunchbang are great.  Especially the one for updating and upgrading a new installation.  It's right up there in your face.  As we know, executing these resolves so many little niggling issues in one go  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26452
  • Karma: 65531
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: Wrong partition ID on /DATA partition [SOLVED]
« Reply #13 on: February 09, 2016, 07:50:38 am »
So how is this post installation update script presented to the user (and when) ?

If it's via a "Welcome Screen", I'm still unsure if I like those or not .. some people seem to think they're great, but IIRC nobody liked the Vista one and everyone was glad it was gone in Windows 7
« Last Edit: February 09, 2016, 07:54:16 am by PCNetSpec »
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4889
  • Karma: 1058
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 10 (64-bit)
Re: Wrong partition ID on /DATA partition [SOLVED]
« Reply #14 on: February 09, 2016, 10:49:04 am »
So how is this post installation update script presented to the user (and when) ?

If it's via a "Welcome Screen", I'm still unsure if I like those or not .. some people seem to think they're great, but IIRC nobody liked the Vista one and everyone was glad it was gone in Windows 7
No it's not quite like Vista.  It's far simpler, less cumbersome and much quicker to implement.  With BunsenLabs, (Crunchbang), a terminal window with the default geometry is automaticall opened immediately after the post installation reboot.  This is a one time time.  It contains text explaining about the importance of keeping your distro up to date.  You're given the option to proceed or not y/n.  If you choose: y, you're asked for your User Password with the usual Debian speech about privacy and being careful.  Click yes and the script automates the update, upgrade and dist-upgrade asking you to confirm where necessary.  It then moves on to standard meta-packages, such as LibreOffice each with a brief explanation.  After that section has completed or, if you choose not to install these packages.  You're presented with optional developer packages to install, such as openSSH.  After you're either done downloading or, select to opt out for this.  You're presented with some cheerful text telling you that you're all done.  That's it.  It's a nice way to ensure the distro is up to date; especially later on in its lifespan.  It also very softly introduces newbies to the terminal window.  I think a post-installation script gives users the reassurance that they've installed things correctly.  It also knocks so many little operational issues on the head in a few minutes.  It saves the newbie galloping to the forum with tales of woe and sorrow.  I really like how simple and user friendly the whole process is.  Obviously, any startup script could be very easily written to suit the distro's core philosophy and the targeted user base  ;).
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.