15

We have two options;

  1. creating a primary partition (say D:) or

  2. creating an extended partition, then create a logical partition (say D:) in the extended partition

In terms of data security, data loss or anything else, is there any difference, if we keep data in primary partition or if we keep data in logical partition?

muru
  • 1,195
  • 9
  • 33
FewL
  • 367
  • 1
  • 2
  • 11
  • Are you using the primary partition to install the operating system? – Nimesh Neema Jun 25 '19 at 17:23
  • 1
    Any reason you don't just extend your c: to cover the entire disk? Acceptable answers include UAC performance, data backup strategies and shared partition for dual boot data sharing. – Aron Jun 27 '19 at 03:35
  • I believe that a question "why people did that in the past" (I did) would yield answers more thorough and informative. Eg on retrocomputing. – Agent_L Jun 27 '19 at 11:22

6 Answers6

27

In terms of data security, whether you have all your data & OS on the same partition or you split a single drive into two partitions makes no difference whatsoever.

If the drive fails, or you get a nasty virus, or you just delete a file & don't notice for a couple of days, then your partitioning didn't improve your chances at all.

For data loss-prevention, your only security is to never keep only one copy of anything.
There's an adage...

"Any data not stored in at least three distinct locations ought to be considered temporary."

In short, that means at minimum you need one on-site backup & one off-site backup [in case the house burns down.] The on-site backup must at least be a different physical drive, if not a different physical machine.
You must periodically actually test you can recover from these backups - otherwise you wasted your time saving them.

Having all your eggs in one basket... it doesn't matter if you have two baskets, if you're carrying them both in the same hand.
Assuming data is 'safe' because it's on a different partition on the same physical drive, no matter how you format it, is 'all eggs in one basket'.
Drop one, you dropped the lot.

Tetsujin
  • 47,296
  • 8
  • 108
  • 135
  • I observed tech steps followed by two tech guys. Windows 10 was installed in C: Using diskpart, extended partition was created, then a logical partition (D:) was created in extended partition. Both tech guys preferred to keep data in logical partition. I couldn’t understand why. – FewL Jun 25 '19 at 18:22
  • 4
    It's an old [& ultimately pointless] method to 'protect' your data in case you ever have to reinstall the OS. I honestly wouldn't bother with it, it offers no real protection from anything. – Tetsujin Jun 25 '19 at 18:36
  • 4
    @user725162, the reason may have nothing to do with security. As K7AAY describes, extended and logical partitions are used with MBR. MBR supports a maximum of 4 primary partitions. Using one of those for an extended partition allows you to exceed the limit by using logical partitions. When you start using recovery and other dedicated partitions, it's easy to use up the allowance of 4. – fixer1234 Jun 25 '19 at 20:56
  • 6
    I don't think OP has even 2 baskets. OP has one basket with a piece of cardboard separating the eggs. – MonkeyZeus Jun 26 '19 at 14:23
  • The adage you quote is unfortunately just arbitrary rule made up by someone. Why 3 locations and not 2 or 4? – kukis Jun 27 '19 at 05:17
  • 4
    @kukis - It is neither unfortunate nor arbitrary, it's an absolute minimum, hence **at least three** - I even explain **why** directly underneath it. – Tetsujin Jun 27 '19 at 06:21
  • @Tetsujin While it doesn't protect you against hardware failures, data corruption etc., it does protect you against yourself when you do clean re-install of your OS. Your OS crashed and doesn't boot anymore? Format the OS partition and re-install, don't have to tinker with some Live USB Linux to recover the last 20 minutes of work, which would otherwise be lost, because you don't do your off-site backup every 20 minutes, do you? – Headcrab Jun 27 '19 at 08:11
  • @Headcrab - I do my offsite overnight, my onsite once an hour [I also have some very important stuff on immediate cloud sync.] So yes, I could potentially lose 59 minutes of work on a sudden drive fail, or 'all of today' if the house did burn down. I haven't needed to clean install an OS since about 2004, & though I have had drives die on me, I can be up & running as though I hadn't left off, inside an hour. – Tetsujin Jun 27 '19 at 08:31
  • @Tetsujin You had hard drives die on you, yet you didn't have to clean install an OS - how does that work? Do you back up your entire hard disk and then use that backup on the new one? – Headcrab Jun 27 '19 at 08:50
  • @Headcrab - A backup is only any use if you can use it to directly restore your machine to the state it was in at the time of the last backup. I'm not sure how else you'd want to do it. The restore simply puts all the data, including the OS as it was at that time, onto a fresh drive. [The offsite backup can't do that, it's data only for sake of data size.] – Tetsujin Jun 27 '19 at 08:54
  • 3
    I would also add _regular verification/restore-able proof_ to the "at minimum" requirements for a strategy against data loss. This is often forgotten or downgraded as a priority. – Stacker Lee Jun 27 '19 at 11:26
  • 2
    @StackerLee - I'd assumed that would be implicit, but very valid point! Added to answer. – Tetsujin Jun 27 '19 at 18:52
  • 1
    What a bunch of nonsense. "Backup is only any use if you can use it to directly restore your machine to the state it was in "? Seriously? This is such an insane statement, I'd think you were trolling if the rest of your comments weren't trying to be serious. – Davor Jun 28 '19 at 12:41
  • 1
    @Davor - you could explain your reasoning if you like, rather than make pointless & unsubstantiated accusations. What's the use of a backup that can't be used to restore your machine? Sure, you could just backup your documents... then you'd have to re-install a clean OS & all your apps, reset all your prefs, hope you can relink all your passwords & security... That's an acceptable risk for your offsite backup, but a bit pointless for your onsite with no data restrictions. – Tetsujin Jun 28 '19 at 13:33
  • @Tetsujin - I don't see any need to explain such an absurdity, but sure. For 99.99% of people, the point of backup is to prevent data loss, not to serve as a system restore. Matter of fact, I've never seen a backup that stores the OS in the first place. Such thing is nonsensical. – Davor Jun 28 '19 at 17:07
  • 1
    @Davor - just because **you** don't do it doesn't mean no-one else does. Mac & Windows, all the machines here can be fully restored within an hour, because the backup strategy is designed to do it. I've been doing the same since I had DAT drives in the 90s. These days I have Time Machine & Acronis. If you can't be bothered to do it properly, don't rail against others who take sufficient care that it works. If you think a day's downtime for a failed drive is a good use of your time & money, then feel free to skimp on your backup strategy. – Tetsujin Jun 28 '19 at 17:18
  • @Tetsujin - no, that has nothing to do with what you previously said. You explicitly claimed that a backup that doesn't function as a system restore is useless. This is absolutelly, hilariously wrong. "Just because you don't do it doesn't mean no-one else does" does not excuse such an absolute claim. Also, your cost-benefit analysis is completelly off. Drives fail once every few years if you are unlucky, and never in your life for most users. Constantly spending resources for this eventuality is simply not cost effective. – Davor Jun 30 '19 at 12:08
  • 1
    I had three boot drives fail in a year in this building. No data was lost, no machine took more than an hour to restore. Your insistence on going over the same pointless ground now makes you look a fool or a troll. A drive only needs to fail once. Both Time Machine & Acronis do full-machine backups by default, so everyone using either of those does it. A 4TB HD is less than a day's wages. Work out the cost to production. – Tetsujin Jul 01 '19 at 06:20
  • They are not asking about splitting partitions. They are asking about using a Primary partition versus a Logical partition. https://superuser.com/q/337146/144442 – zymhan Jul 12 '19 at 16:25
  • @zymhan - it still makes not the slightest difference to their actual criterion, which is "security &/or data loss". – Tetsujin Jul 12 '19 at 16:27
  • 1
    I agree, but your answer begins with the premise of single versus multiple partitions, which was at no point brought up in the question. They asked "is there any difference, if we keep data in primary partition or if we keep data in logical partition". – zymhan Jul 12 '19 at 16:29
  • 1
    I do wish this wasn't the top answer as it has no real useful information and doesn't answer the initial question in any way. – Michael Mantion Nov 26 '20 at 22:25
  • @MichaelMantion - "better" isn't defined until the last paragraph of the OP's question. Once it is defined as 'security/data loss' then all other considerations go right out of the window. – Tetsujin Sep 27 '21 at 13:14
18

If you are using a Logical Partition in an Extended Partition, then you are using the old-fashioned MBR Partition Table which is limited to drives of 2TB or less. The current standard for Windows 10 is the GPT Partition Table which arrived alongside EFI and UEFI Booting. GPT has additional features which help protect your data better, transparantly. Microsoft has provided an article on conversion.

Therefore, storing your data on an MBR partitioned drive is less safe than a GPT partitioned drive, but Tetsujin's also very right, and I voted for his answer.

K7AAY
  • 9,512
  • 4
  • 33
  • 62
  • 1
    GPT is unrelated to UEFI. Yes, it's the native format for UEFI bootloader, but you can easily boot a BIOS-based system from a GPT-formatted storage device. – Ruslan Jun 26 '19 at 14:31
  • 2
    @Ruslan You're technically correct, but in practice Windows won't boot with UEFI from MBR drive or with BIOS/CSM from GPT drive - implementation limitation. – gronostaj Jun 28 '19 at 07:41
  • @gronostaj [Citation needed]. A quick search seems to come back with ways to have Windows with GPT and UEFI. –  Jun 28 '19 at 11:20
  • 2
    @CamilaHunter That's what I said. UEFI+GPT is fine. BIOS+MBR is fine. UEFI+MBR doesn't work. BIOS+GPT doesn't work. If my memory serves macOS behaves like this too, I haven't tested it myself but I think somebody here on SU said it. – gronostaj Jun 28 '19 at 12:00
  • @gronostaj I meant BIOS mb –  Jun 28 '19 at 12:04
  • What is the link on "help protect your data better" about? The only safety measures GPT has is the secondary table and the CRC but they are hardly highlighted in the linked page. – Margaret Bloom Jun 28 '19 at 12:51
  • "a GUID Partition Table is composed of a Protective MBR which is used in a way that prevents MBR-based disk utilities from misrecognizing and possibly overwriting GPT disks, a primary GUID partition table header which records its own size and location and the size and location of the secondary GPT header, a primary GUID Partition Entry Array, a backup GUID Partition Entry Array, and a backup GUID Partition Table Header. A GUID partition table could contain up to 128 partition entries in Windows." from https://www.minitool.com/partition-disk/mbr-vs-gpt-guide.html – K7AAY Jun 28 '19 at 17:12
  • In gParted, you can only choose between "Primary" and "extended". Of these, "extended" is the newer and, afaik, better option, as you can only have 4 primary partitions. extended / logical partitions were originally created to circumvent this limitation, as an extended partition w/ 100 logical subs is seen by the system as 1 primary. Regardless of how many Win will recognize with eufi, most partition editors will not let you make more than 4. I know gParted still will not; I just tried as a test. You get an error prompt. If you are on Windows, you should try it with PartDisk. I am curious. – Nate T Oct 02 '21 at 04:16
  • @gronostaj you are correct, as the original purpose of extended partitions was to fool the machine into thinking it was a single primary partition, regardless of how many partitions in actually encased. Any medium that supports primary should support extended, I would think, unless it was designed not to. – Nate T Oct 02 '21 at 04:24
5

In theory there is a difference insofar as an extended partition requires two LBAs (the MBR plus the first sector in the extended partition) to be written to once, and to be read subsequently on every mount. A primary partition only requires one LBA (the MBR).

So, strictly speaking, in terms of data security, a primary partition is 50% less likely to fail. In practice, 1/1015 and 50% of 1/1015 are pretty much the same. So, do whatever you like. But why not just use a primary partition if there's only one partition on the disk so far! There's no reason not to go with a primary partition, really. Saves you one useless disk seek on mount.

When setting up completely from scratch (which is not the case from the wording of your question, since you want to assign drive letter D:, so that's not an option), you might consider GPT.
That will only work if you have a reasonably recent computer and operating system, but in that case it will have some (minor) advantages. The most important advantage is that you can have partitions larger than 2 TB and you can boot Windows in UEFI mode (presumed all other preconditions hold).

Note that contrary to urban myth, GPT is not necessarily much safer than MBR. While GPT does store a second GPT table at the end of the disk which sounds just great, it also requires at least twice as many LBAs to work, which again doubles the rate of unrecoverable read failures. So... at the end of the day, it's pretty much the same.

Damon
  • 4,512
  • 3
  • 22
  • 28
  • 2
    GPT *is* likely safer than MBR because the backup table at the end is a complete clone of the primary one. As long as you don't get two UREs at the exact same time for both sectors holding the two copies of the table, everything is perfectly recoverable without any hassle. There's no redundancy like that in MBR, a loss of any of the sectors holding the partitioning data means you'll have to reconstruct the table by hand. Also, I'd guess it's quite likely that someone destroys the first few sectors by accident (by incorrect parameters to `dd` or so). GPT survives that just fine, MBR doesn't. – TooTea Jun 26 '19 at 08:29
  • "...a primary partition is 50% less likely to fail..." Assuming that the only point of failure is the MBR plus extended partition. However, if you allow that other sectors on the disk beside these can fail, the difference becomes a lot less (usually, negligible). – cjs Jun 26 '19 at 15:38
  • +1 Only answer so far to even *try* to answer the question asked. – lx07 Jun 26 '19 at 18:33
3

When creating a second partition for data storage (i.e., not the boot partition) for an OS, the primary difference here is that it may affect your ability to create more partitions later.

There are four primary partition slots on an MBR-formatted drive. One of these may be used to create/hold an extended partition, which in turn allows additional partitions on the drive that do not use any of the remaining three primary partition slots in the MBR.

If all four primary partition slots are allocated to primary partitions, it's no longer possible to add an extended partition and thus you can add no more partitions to that drive, even if you have free space. Therefore it's standard practice, when creating the first partition for which an extended partition slot can be used, to create it as an extended partition. This ensures that further additions can never run out of partition slots.

Some older or less sophisticated boot programs may not be able to boot from an extended partition but only from a primary one, so it's also good practice not to use a primary slot for a partition you know you will never want to boot, leaving it free in case you later need another bootable partition.

cjs
  • 918
  • 1
  • 6
  • 13
2

It doesn't increase security, however it makes it more convenient to reinstall Windows by formatting only C drive, leaving data unharmed.

Just don't forget to copy contents of MyDocuments and Desktop folders.. and favorites from browsers.. and settings and game saves from %AppData% folder... So you can see, newer Windows keeps data all over the place now, making this technique kinda moot.

0

I myself use 3 drives. 2 are data only, the other is a small drive <120GB. I use that on strictly as my C drive. This way, in case of OS failure, I just restore my BU image of the drive and poof, back up and running. If I lose the C drive itself, I can just replace it and drop the image back on all the while, my data is in tact and unharmed.