Running Linux on a Partitionless disk

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
Quaker763
Posts: 17
Joined: Sun Mar 08, 2015 5:32 am
Location: Straya

Running Linux on a Partitionless disk

Post by Quaker763 »

Hey guys,

So I just installed arch linux the other day, but when installing it completely slipped my mind to use /dev/sda1 instead of /dev/sda when using mkfs, mounting etc. Doh! :cry:

I now have NO partition table, but the whole disk is formatted to ext4 with GRUB2 and runs perfectly.

I guess the question is (for anyone experienced with ext4/linux partituoning) will I suffer any data corruption/degredation from having no partition table or possibly erode the drive more (it's a 250gb SSD)?
MasterLee
Member
Member
Posts: 90
Joined: Fri Mar 13, 2009 8:51 am

Re: Running Linux on a Partitionless disk

Post by MasterLee »

On all hard disk where i only have one Partition i get rid of partition table and never lost any data on those disks in the last five years. Well i never lost data under Linux only on Windows.
50₰
User avatar
Quaker763
Posts: 17
Joined: Sun Mar 08, 2015 5:32 am
Location: Straya

Re: Running Linux on a Partitionless disk

Post by Quaker763 »

So one huge volume should be fine partitionless? I'm actually surprised it booted considering I have no MBR. Maybe thats why GRUB was angry when I tried to install it haha.
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: Running Linux on a Partitionless disk

Post by onlyonemac »

Perhaps GRUB made a fuss during installation, but if it's installed now then there's no reason why it won't work. Your BIOS doesn't know the difference between an MBR and a VBR, so it loads the VBR as if it was an MBR and assumes that it will do its thing. Meanwhile, the GRUB VBR doesn't care that it was loaded directly by the BIOS because GRUB is designed to work as a VBR anyway and there's no way for GRUB to know if it was loaded by the BIOS or by an MBR (which is why you can install GRUB to either the MBR or a VBR on a normally-partitioned hard drive).

The only problems that I can imagine is if you ever want to partition the hard drive, or if you're following online tutorials and they're referring to separate partitions. I imagine that some software might get confused if there are no /dev/sda1, /dev/sda2, etc. devices, or it might assume that /dev/sda has a partition table at the beginning (e.g. gparted).

In short, it's an interesting exercise but I strongly suggest that, since this is a fresh install that you messed up, you re-install it correctly before you start using it routinely.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Running Linux on a Partitionless disk

Post by Brendan »

HI,

In addition to what other people have already said...

I'd recommend having a minimum of 2 partitions for any OS - one for the easily replaced/reinstalled stuff (the OS, applications, etc), and a separate partition for user data. This makes it easy to only backup user data, and makes it easy to wipe the OS without losing user data. It also gives you some simple disk quotas (e.g. accidentally filling up the user data partition doesn't cause applications to fail due to "not enough space for temp. files", etc).

For OS developers; I'd also consider having a small (500 MiB?) "unused" partition, just in case you feel like installing your own OS one day.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
onlyonemac
Member
Member
Posts: 1146
Joined: Sat Mar 01, 2014 2:59 pm

Re: Running Linux on a Partitionless disk

Post by onlyonemac »

Brendan wrote:For OS developers; I'd also consider having a small (500 MiB?) "unused" partition, just in case you feel like installing your own OS one day.
That probably isn't necessary. Re-partitioning isn't really a big deal.
When you start writing an OS you do the minimum possible to get the x86 processor in a usable state, then you try to get as far away from it as possible.

Syntax checkup:
Wrong: OS's, IRQ's, zero'ing
Right: OSes, IRQs, zeroing
User avatar
iansjack
Member
Member
Posts: 4685
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Running Linux on a Partitionless disk

Post by iansjack »

Quaker763 wrote:So one huge volume should be fine partitionless? I'm actually surprised it booted considering I have no MBR. Maybe thats why GRUB was angry when I tried to install it haha.
Why wouldn't it boot? It's got a boot sector and an MBR is just a specialized boot sector. I can think of no reason why this setup, unusual though it is, should cause any problems. But it does mean that if you wish to partition the disk at a later stae it will be a destructive process.
Antti
Member
Member
Posts: 923
Joined: Thu Jul 05, 2012 5:12 am
Location: Finland

Re: Running Linux on a Partitionless disk

Post by Antti »

iansjack wrote:Why wouldn't it boot? It's got a boot sector and an MBR is just a specialized boot sector.
It is likely that it boots. However, it may not boot because some BIOS implementations are not just checking the boot signature. They may parse the partition table and calculate proper "sectors per track" and "heads" values from it so that legacy master boot records work. If we had an invalid partition table, this all could jump into an "untested" error handler. I recommend being defensive and avoid unusual master boot record layouts.
User avatar
Quaker763
Posts: 17
Joined: Sun Mar 08, 2015 5:32 am
Location: Straya

Re: Running Linux on a Partitionless disk

Post by Quaker763 »

iansjack wrote:Why wouldn't it boot? .
I read somewhere that some BIOS'es will refuse to boot an operating system with no partition info. My friend installed arch with no partition as well, and he was unable to boot, though HDT detected GRUB2.

Thanks for the help and advice guys, I just did a reinstall on /dev/sda1, so I have one large primary partition formatted to ext4, and GRUB installation made 0 fuss this time. Thank god I only had to copy my home folder haha.

I suppose all this will come in handy when I finally get around to writing disk drivers for my OS. :)
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Running Linux on a Partitionless disk

Post by Combuster »

Quaker763 wrote:
iansjack wrote:Why wouldn't it boot? .
I read somewhere that some BIOS'es will refuse to boot an operating system with no partition info.
UEFI requires a FAT partition and a GUID partition table because it boots on filename basis rather than sector basis. Legacy disabled is also the default BIOS setting for quite a few if not most new computers.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply