You are not logged in.

#1 2015-01-13 16:18:27

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Rename /dev/sda2 to /dev/sda1? [Solved]

Up until recently I had two partitions on /dev/sda. I deleted the first one and now I only have one, the second one (/dev/sda2).

[me@chromebook ~]$ lsblk
sda      8:0    0 14.9G  0 disk 
`-sda2   8:2    0 14.9G  0 part /
sdb      8:16   1 29.5G  0 disk 
`-sdb1   8:17   1 29.5G  0 part /home/me/SD

Everything works fine but it kind of bothers me that the only partition in /dev/sda has the number 2. How can I make it be called /dev/sda1? Then I'll just update my fstab and everything should be alright.

Last edited by PolyBender (2015-01-13 20:37:25)

Offline

#2 2015-01-13 16:19:40

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

Have you rebooted?


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2015-01-13 16:21:02

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

Yes, many times since. I thought it would fix it too but it's still called /dev/sda2.

Offline

#4 2015-01-13 16:25:14

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

You're using gpt and that's probably normal.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#5 2015-01-13 16:27:32

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,399
Website

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

fdisk can "fix" this, using the "fix partitions order" under the "extra functionality (experts only)" menu.

However, this is purely cosmetic, and presumably is potentially dangerous, which is why it's hidden in the expert menu.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2015-01-13 16:29:13

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

nomorewindows wrote:

You're using gpt and that's probably normal.

Actually I'm not. I manually converted it to MBR using gdisk because I didn't want to have to leave extra free memory at the start of the drive given how small a chromebook's memory already is.

WorMzy wrote:

fdisk can "fix" this, using the "fix partitions order" under the "extra functionality (experts only)" menu.

However, this is purely cosmetic, and presumably is potentially dangerous, which is why it's hidden in the expert menu.

Thanks for the reply, I just tried that and it seems like it should work but I get this instead:

Command (m for help): x

Expert command (m for help): f
Nothing to do. Ordering is correct already.

Last edited by PolyBender (2015-01-13 16:36:57)

Offline

#7 2015-01-13 16:32:53

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

Even though there's only one partition, it is partition 2 according to the partition table. And the device name is based on that. If you really need it to be sda1 you'll have to delete and re-create it, which will require manually specifying its geometry. IMO you should have sda2 absorb that free space left by sda1 one way or another though.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#8 2015-01-13 16:35:59

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

alphaniner wrote:

Even though there's only one partition, it is partition 2 according to the partition table. And the device name is based on that. If you really need it to be sda1 you'll have to delete and re-create it, which will require manually specifying its geometry. IMO you should have sda2 absorb that free space left by sda1 one way or another though.

Thanks for the reply. I was hoping that maybe there was an easy way to edit the partition table instead. There's no free memory left, I maximized the partition's size using the gparted live iso so I'm okay on that point.

Offline

#9 2015-01-13 20:13:33

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,269
Website

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

You can re-order the partitions using gdisk, I did this with mine:

Number  Start (sector)    End (sector)  Size       Code  Name
   1       233394176       234441614   511.4 MiB   EF00  EFI System
   2            2048       201326579   96.0 GiB    8300  Linux filesystem
   3              34            2047   1007.0 KiB  EF02  BIOS boot partition
   4       209712510       233394175   11.3 GiB    8300  Linux filesystem
   5       201326592       209711103   4.0 GiB     8200 

Partition number 1 was originally partition number 3 (I converted it to EFI-mode); now if I use:

# gdisk /dev/sda

an press "s" (sort the partitions), I get:

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34            2047   1007.0 KiB  EF02  BIOS boot partition
   2            2048       201326579   96.0 GiB    8300  Linux filesystem
   3       201326592       209711103   4.0 GiB     8200  
   4       209712510       233394175   11.3 GiB    8300  Linux filesystem
   5       233394176       234441614   511.4 MiB   EF00  EFI System

As you can see, this has sorted them in sector order smile

You can use "x" (expert options) and then "t" to transpose two partition table entries if the "sort" option doesn't work wink

Last edited by Head_on_a_Stick (2015-01-13 20:15:50)


Para todos todo, para nosotros nada

Offline

#10 2015-01-13 20:25:40

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,403

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

He said he wasn't using gpt unless gdisk will still do it (or a conversion back and forth in the process).


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#11 2015-01-13 20:32:34

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,269
Website

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

Ooops sorry missed that!

@OP: I don't understand your point about "free memory" at the start of the drive -- surely a few KiB won't make any difference?

GPT is better than MBR purely because of the backup table (I have used this myself to save a disk on more than one occasion).


Para todos todo, para nosotros nada

Offline

#12 2015-01-13 20:36:58

PolyBender
Member
Registered: 2013-05-11
Posts: 24

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

Head_on_a_Stick wrote:

Ooops sorry missed that!

@OP: I don't understand your point about "free memory" at the start of the drive -- surely a few KiB won't make any difference?

GPT is better than MBR purely because of the backup table (I have used this myself to save a disk on more than one occasion).

You're probably right. I had a few issues with my install and switching to MBR really helped me make it work. I think I'll play with it and try to switch it back to GPT sometime, I'm sure I can make it work. It'll probably fix the partition names too. I'll mark this as solved because there isn't much more to say or do. Thanks everyone!

Offline

#13 2015-01-13 20:43:49

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,269
Website

Re: Rename /dev/sda2 to /dev/sda1? [Solved]

If you're booting in non-EFI mode, you will need a BIOS boot partition (ef02) with a GPT disk and it may not work at all (it is firmware dependent), so you may have to stick with MBR and a "wonky" partition table.


Para todos todo, para nosotros nada

Offline

Board footer

Powered by FluxBB