LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-06-2016, 10:19 PM   #1
prahladyeri
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Rep: Reputation: Disabled
A basic query about Linux partitioning


I'm trying to understand the partition table of my MTK-6572 based android smart-phone (Karbonn-A35). The idea is to enlarge the Internal Storage partition (mounted as /data) and correspondingly shrink the Phone Storage partition (mounted as /mnt/sdcard), so that I can install more apps on the phone without getting the "Disk Full" error. However, there is one thing I want to understand before proceeding to change the EBR1 partition file. Presently, here is how my MBR & EBR1 look like (yeah, I'm also wondering why the heck do they create an extended partition of 2TiB in size, whilst my sdcard is just 2GB!):

Code:
	--- MBR
	Regular file, size 512 bytes
	DOS/MBR partition map
	Partition 1: 2.000 TiB (2199023255040 bytes, 4294967295 sectors from 1024)
	  Type 0x05 (Extended)
	Partition 2: 10 MiB (10485760 bytes, 20480 sectors from 18432)
	  Type 0x83 (Linux)
	Partition 3: 10 MiB (10485760 bytes, 20480 sectors from 38912)
	  Type 0x83 (Linux)
	Partition 4: 650 MiB (681574400 bytes, 1331200 sectors from 113152)
	  Type 0x83 (Linux)


	--- EBR1
	Regular file, size 512 bytes
	DOS/MBR partition map
	Partition 1: 376 MiB (394264576 bytes, 770048 sectors from 1443328)
	  Type 0x83 (Linux)
	Partition 2: 1.293 GiB (1388314624 bytes, 2711552 sectors from 2213376)
	  Type 0x83 (Linux)
	Partition 3: 1.998 TiB (2196501691904 bytes, 4290042367 sectors from 4924928)
	  Type 0x83 (Linux)
If you see the 4th and 5th partitions (i.e. the end of 4th in MBR and beginning of 1st in EBR1), there is some overlap. The fourth partition says `1331200 sectors from 113152`. But when you count 1331200 sectors from 113152, you get 1444352 from where the next partition should begin. However, the next partition (i.e. the 1st in EBR) begins from 1443328 which is a bit earlier than that. Isn't that a kind of overlap for those few sectors (1444352−1443328=1024)? Those 1024 sectors are both part of 4th and 5th partitions? Or am I missing something about my understanding about partition tables?


That's one thing, another thing is about the third partition in EBR1. This wikipedia article on EBR says that only the first two entries in an EBR are supposed to be used:

Code:
EBRs have essentially the same structure as the MBR; except **only the first two entries of the partition table are supposed to be used**, besides having the mandatory boot record signature (or magic number) of 0xAA55 at the end of the sector.
Then how come the EBR1 of my device contains three entries? Again, is this a non-standard thing or am I missing something?
 
Old 07-06-2016, 10:44 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 11,651
Blog Entries: 12

Rep: Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894
Even though the Android kernel is Linux, the Android partitioning scheme is very much its own thing. I've never seen anything in a Linux distro at all like it. I'd be reluctant to mess with the partitions on my own HTC One.

I found this article that might be a good starting point: http://www.addictivetips.com/mobile/...ta-cache-misc/
 
1 members found this post helpful.
Old 07-06-2016, 11:01 PM   #3
prahladyeri
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by frankbell View Post
Even though the Android kernel is Linux, the Android partitioning scheme is very much its own thing. I've never seen anything in a Linux distro at all like it. I'd be reluctant to mess with the partitions on my own HTC One.
What you are saying is generally true, but also differs between manufacturers and chipset makers. Typically, the MediaTek chipset (MTK65xx) based phones all follow the same standard loosely guided by the stock AOSP & AOKP reference implementations. These phones are sold by small and startup OEMs like Karbonn & Micromax in India and Xiaomi in China.

However, OEMs like Samsung and HTC like to tightly control their platforms (the way Apple does), so they customize the OS so heavily that it becomes something totally different. Their idea is that you shouldn't be able to mod the HTC One the way you mod your linux distro, that's why they keep it so hard.

Samsung also recently introduced their own chipset called Exynos instead of using Snapdragon or MediaTek. This new chip is totally undocumented, so there is no developer support, so modding is nearly impossible!

Last edited by prahladyeri; 07-06-2016 at 11:07 PM.
 
Old 07-06-2016, 11:41 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mageia, and whatever VMs I happen to be playing with
Posts: 11,651
Blog Entries: 12

Rep: Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894Reputation: 2894
Quote:
However, OEMs like Samsung and HTC like to tightly control their platforms (the way Apple does), so they customize the OS so heavily that it becomes something totally different. Their idea is that you shouldn't be able to mod the HTC One the way you mod your linux distro, that's why they keep it so hard.
prahladyeri, thanks for the informative post. You clearly know much more about Android than I do.
 
Old 07-07-2016, 08:54 AM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 7,480

Rep: Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376Reputation: 2376
And, isn't /mnt/sdcard a totally different device? Namely, "the SD card," versus the on-board memory.
 
Old 07-07-2016, 11:03 AM   #6
prahladyeri
LQ Newbie
 
Registered: Mar 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sundialsvcs View Post
And, isn't /mnt/sdcard a totally different device? Namely, "the SD card," versus the on-board memory.
To the best of my knowledge, that isn't true. Inside your device there is only one big sdcard or device of 8GB, 16GB, etc. (even mentioned in the specs). Then inside it, the OEMs do the android partitions like /boot, /data, /recovery, etc. The /mnt/sdcard is just one of those partitions, not a separate device. If its a separate device (eMMC) they would state so in your device specs.
 
  


Reply

Tags
android, partition table


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SUSE Linux 10.1: Partitioning Disks Simple Query linuxFNG Linux - Newbie 4 01-25-2008 04:20 PM
Partitioning for Multiple Linux Distributions Query Tony Bradley Linux - Desktop 1 01-18-2007 08:45 AM
SSL : Basic Query vikasumit Linux - General 1 05-08-2006 02:30 AM
Partitioning query ?? bigjohn General 6 01-07-2005 10:49 PM


All times are GMT -5. The time now is 10:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration