OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 2:19 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 9:05 am 
Offline
User avatar

Joined: Sun Mar 08, 2015 5:32 am
Posts: 17
Location: Straya
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)?


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 9:21 am 
Offline
Member
Member

Joined: Fri Mar 13, 2009 8:51 am
Posts: 90
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₰


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 9:27 am 
Offline
User avatar

Joined: Sun Mar 08, 2015 5:32 am
Posts: 17
Location: Straya
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.


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 10:21 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
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


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 11:15 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
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.


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 11:59 am 
Offline
Member
Member

Joined: Sat Mar 01, 2014 2:59 pm
Posts: 1146
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


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Dec 28, 2015 4:36 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Tue Dec 29, 2015 12:29 am 
Offline
Member
Member

Joined: Thu Jul 05, 2012 5:12 am
Posts: 923
Location: Finland
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.

_________________
Undefined behavior since 2012


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Tue Dec 29, 2015 1:56 am 
Offline
User avatar

Joined: Sun Mar 08, 2015 5:32 am
Posts: 17
Location: Straya
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. :)


Top
 Profile  
 
 Post subject: Re: Running Linux on a Partitionless disk
PostPosted: Mon Jan 04, 2016 6:10 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
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 ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 37 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group