navitron
 
Renewable Energy and Sustainability Forum
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Anyone wishing to register as a new member on the forum is strongly recommended to use a "proper" email address - following recent spam/hack attempts on the forum, all security is set to "high", and "disposable" email addresses like Gmail, Yahoo and Hotmail tend to be viewed with suspicion, and the application rejected if there is any doubt whatsoever
 
Recent Articles: Navitron Partners With Solax to Help Create A More Sustainable Future | Navitron Calls for Increased Carbon Footprint Reduction In Light of Earth Overshoot Day | A plea from The David School - Issue 18
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Linux partitioning gurus?  (Read 13766 times)
Greenbeast
Hero Member
*****
Offline Offline

Posts: 2280


WWW
« on: May 06, 2014, 10:07:16 PM »

I have bought a 3Tb drive that i plan to use with a RPi (running raspbmc)
But i also want to be able to mount it in windows.

I gather i need to use GPT rather than MBR to access the full capacity.

However... every time i plug it into either my rpi or my windows machine it wants to be initialized.

So for example if i use parted to create the gpt and then create a ntfs partition i can mount it and create a folder on the Rpi
Then if i plug it into windows using sata it wants to initialize it and if i use the same usb adapter i use with the RPi it wants to format it.

If i initialize it and format it using windows, linux doesn't see the partitions

any ideas?
Logged
Eccentric Anomaly
Sr. Member
****
Offline Offline

Posts: 404


WWW
« Reply #1 on: May 06, 2014, 10:53:52 PM »

Hmmm, reads a bit of https://en.wikipedia.org/wiki/GUID_Partition_Table then decides it's bedtime. Sorry, can't suggest anything other than pointing out that if somebody knowledgeable comes along they'll probably want to know if it's Windows 7 or later or whether it's something earlier.

Bit surprised Linux doesn't see the partitions formatted by Windows. What happens if you try to look at it with (g)parted?

BTW, I've formatted a 1 GB thumb drive using gparted as GPT with an ext2 and an NTFS partition then mounted it OK. I realize that's obviously likely to work - just worth trying for my own education (e.g., to see that fdisk knows what it is but won't touch it). Sorry, haven't got any Windows systems to stick it on. Really is bedtime now.
« Last Edit: May 06, 2014, 10:58:50 PM by Eccentric Anomaly » Logged

He who refuses to do arithmetic is doomed to talk nonsense - John McCarthy.
Greenbeast
Hero Member
*****
Offline Offline

Posts: 2280


WWW
« Reply #2 on: May 07, 2014, 08:08:15 AM »

oh sorry, actually that's a good point, i'm using win7. This media player i've built is for someone else that is leaving the country and needs to be compatible with a machine they might buy in the future, i guess that would be win8 which i have no good way of testing.
But if i can get it to work with 7 then it will work with 8
Logged
titan
Hero Member
*****
Offline Offline

Posts: 525


« Reply #3 on: May 07, 2014, 09:48:10 AM »

How does each machine know what partition to access when it is plugged in. Normally the UUID from the GPT is used in Linux  I don't know how MS uses UUIDs. You also mention USB adaptor do you mean a multi plug thing, they are know to be problematic try a USB on the machine direct.
Logged
Ted
Global Moderator
Hero Member
*****
Offline Offline

Posts: 3905



« Reply #4 on: May 07, 2014, 09:57:22 AM »

GB, you might want to read all of this page: http://www.ibm.com/developerworks/library/l-gpt/  especially the highlighted section below:

Linux employs a handful of MBR partition type codes, such as 0x82 and 0x83, to identify its MBR partitions. Similar GUID codes exist to identify Linux GPT partitions. One important caveat is that Linux has traditionally used the same GUID code as Windows for its data partitions. Thus, it's impossible to differentiate Linux partitions and NTFS file system or FAT partitions from their partition table GUIDs alone. This is unimportant on a Linux-only system, but if you dual-boot Windows and Linux on an EFI-based computer or if you create Linux partitions on a removable disk and use it in Windows, the result is that your Linux partitions appear to be uninitialized partitions in Windows, and Windows may ask whether you want to format the partitions if you try to access them. You can correct this problem in gdisk by giving your Linux partitions a gdisk type code of 8300. This new type code should be supported by libparted in the future, but it hadn't been implemented as of libparted version 3.1.
Logged

Volunteer moderator
Greenbeast
Hero Member
*****
Offline Offline

Posts: 2280


WWW
« Reply #5 on: May 07, 2014, 10:41:47 AM »

many thanks ted! i will look into this this evening
Logged
Greenbeast
Hero Member
*****
Offline Offline

Posts: 2280


WWW
« Reply #6 on: May 07, 2014, 10:07:49 PM »

ok think i've sorted it using gdisk to correct the type code, so it's now set as microsoft basic data with ntfs file system on it

thanks ted
Logged
Mostie
Sr. Member
****
Offline Offline

Posts: 495



« Reply #7 on: May 07, 2014, 11:13:23 PM »

I think.....  if its formatted with FAT32 it can be recognized by Linux and Windows.
You might need to split it into smaller partitions.
Logged

2x Solis PV = 1.875 kW, Mitsubishi inverter heat pump. Yorkshire Boiler Stove.
wookey
Hero Member
*****
Offline Offline

Posts: 3220


WWW
« Reply #8 on: May 15, 2014, 03:11:08 AM »

fat32 is no use on linux except for data. You can't put a bootable filesystem on a fat partition as it can't express permissions, links, executable status, device nodes etc. (It's an exceedingly shoddy filesystem in fact that we really ought to be shot of by now).

Looks like Ted has solved the original issue. I always use cfdisk (or fdisk if feeling hardcore) rather gparted to see what's _really_ on my disk. It's possible that those don't know about new-fangled GPTs (I've not had to fiddle with those yet).

The other thing I'd say is 'always use LVM' (logical volume management) when formatting disks. It's the dogs danglies. Makes it very easy to stretch/shrink/combine/split partitions when you later find that you made things the wrong size or have run out of space in part of the filesystem.
Logged

Wookey
Eccentric Anomaly
Sr. Member
****
Offline Offline

Posts: 404


WWW
« Reply #9 on: May 15, 2014, 09:09:17 AM »

fat32 is no use on linux except for data.

Well, yes, but data is handy sometimes, particularly if you have to exchange it with people using other operating systems. FAT32 on USB sticks, SD cards, etc, seems a sensible default.

Quote
I always use cfdisk (or fdisk if feeling hardcore) rather gparted to see what's _really_ on my disk. It's possible that those don't know about new-fangled GPTs (I've not had to fiddle with those yet).

fdisk was the first thing I tried for the same reason but it doesn't do GPT yet. At least the version in Ubuntu 12.04 LTS doesn't but that's not always very up to date. It does know that it doesn't know, though:

Code:
edavies@bill:~/temp[/color]$ sudo fdisk /dev/sdb

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Command (m for help): p

Disk /dev/sdb: 1031 MB, 1031798784 bytes
255 heads, 63 sectors/track, 125 cylinders, total 2015232 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1     2015231     1007615+  ee  GPT

PS: cfdisk can't open it at all.
« Last Edit: May 15, 2014, 09:19:06 AM by Eccentric Anomaly » Logged

He who refuses to do arithmetic is doomed to talk nonsense - John McCarthy.
djh
Hero Member
*****
Offline Offline

Posts: 2129


« Reply #10 on: May 15, 2014, 10:37:29 AM »

fdisk was the first thing I tried for the same reason but it doesn't do GPT yet. At least the version in Ubuntu 12.04 LTS doesn't but that's not always very up to date.

I believe the latest versions of fdisk DO handle GPT, but I don't remember at what exact version it gained the capability.
Logged

Cheers, Dave
Eccentric Anomaly
Sr. Member
****
Offline Offline

Posts: 404


WWW
« Reply #11 on: May 15, 2014, 11:07:59 AM »

Seems there's a thing called gdisk which does it. Ubuntu
Code:
sudo apt-get install gdisk
works fine:

Code:
edavies@bill:~$ sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 0.8.1

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): p
Disk /dev/sdb: 2015232 sectors, 984.0 MiB
Logical sector size: 512 bytes
Disk identifier (GUID): 71768902-34F1-4A9E-A622-230C87013F65
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 2015198
Partitions will be aligned on 2048-sector boundaries
Total free space is 4029 sectors (2.0 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          411647   200.0 MiB   0700  
   2          411648         2013183   782.0 MiB   0700  

Command (? for help): m
b back up GPT data to a file
c change a partition's name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition's type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu

Command (? for help):
Logged

He who refuses to do arithmetic is doomed to talk nonsense - John McCarthy.
djh
Hero Member
*****
Offline Offline

Posts: 2129


« Reply #12 on: May 15, 2014, 05:29:44 PM »

Quote
Seems there's a thing called gdisk which does it.

I've heard of gdisk, now you mention it, but what I meant was that fdisk does now support GPT. Here's the commit:

http://git.kernel.org/cgit/utils/util-linux/util-linux.git/commit/?id=766d5156c43b784700d28d1c1141008b2bf35ed7

"This patch allows fdisk to handle GUID partition tables, based on the latest UEFI specifications version 2.3.1, from June 27th, 2012."
Logged

Cheers, Dave
Mostie
Sr. Member
****
Offline Offline

Posts: 495



« Reply #13 on: May 15, 2014, 05:41:09 PM »

Hello Mr Wookey, in his original post GB didn't mention booting from the drive, I assumed he simply wanted to switch it between windows and linux, as EA says, just for data. From memory I used fat32 (yes it probably is cac) and thought I would mention it, if you know a better way please enlighten us.
Logged

2x Solis PV = 1.875 kW, Mitsubishi inverter heat pump. Yorkshire Boiler Stove.
wookey
Hero Member
*****
Offline Offline

Posts: 3220


WWW
« Reply #14 on: May 15, 2014, 11:30:12 PM »

FAT32 is indeed the lowest-common-denominator lingua-franca of disks. I assumed that 'use it with RPi' meant that he wanted an OS on it, but yes if it's just for data FAT32 is sensible. NTFS is also a sensible option for linux<->Windows transfer.
Thanks for the enlightenment on GPT support. I'll probably need to know that next time I buy a drive...
Logged

Wookey
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!