Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Unsolved] How to mount a LDM partition?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Thu Dec 13, 2012 1:31 am    Post subject: [Unsolved] How to mount a LDM partition? Reply with quote

Note:I started thinking GPT was my problem, i was partially-wrong...

Hello again those who might remember me, seems i'm back to gentoo after taking a little break, everything is working fine as i've set it up except that i have to mess around with my Creative X-Fi Titanium to make the 5.1 work (again) and well, my new problem.

Last time i was on gentoo mounting my 3Tb hard drive worked fine mounted as a ntfs-3g volume, i logged back into my old gentoo installation yesterday and well... saw that my hard drive was missing, which kicked in my windows instinct to reinstall. (problem i don't understand? reinstall will fix!) i knew i'd end up in the same way again but reinstalled anyways, its a good way to pick up where i left off last time with gentoo.

My 500gb hard drive is detected and so is my 60gb ssd, both are on MBR i believe, and when i saw my storage drive wasn't being detected i looked into it and saw that what made it different from my other drives was that it was set to use GPT.


I did some search, and found a forum post here somewhere by NeddySeagoon saying something about raid, could wipe all files accidentally, and GPT in the same post, deciding not to take my chances on this even if i'm not using RAID (i don't think...) i looked at some more posts on the forum and googled a bit more, but didn't find a guide to how to mount a NTFS GPT partition to linux, or more specifically gentoo. so since most my media is on that drive, its the first thing i want to have to troubleshoot any other problems i'll have to solve.

Does anybody know how i should mount this?
_________________
This picture was my biggest reason for ever trying Gentoo <3


Last edited by rabcor on Sat Jan 05, 2013 1:33 am; edited 3 times in total
Back to top
View user's profile Send private message
alkan
Guru
Guru


Joined: 06 Aug 2004
Posts: 385
Location: kasimlar yaylasi

PostPosted: Thu Dec 13, 2012 4:37 am    Post subject: Reply with quote

I think you need to boot UEFI to mount GPT partitions.
Sorry my bad. That was the windows booted from UEFI to acces the GPT.


Last edited by alkan on Thu Dec 13, 2012 8:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Thu Dec 13, 2012 6:05 am    Post subject: Reply with quote

UEFI and EFI are something in the BIOS right? i do have a motherboard with that...

But how do you mean i hsould "boot uefi"?

i wouldn't think changing the way i boot would change anything, seeing as i don't need to boot from my storage drive... could you somehow elaborate?

I just need to have access to the GPT device after bootup after i login to my GUI (KDE). since most of the stuff on it is media anyways. but i already learned the part about needing grub2 to be able to boot GPT.
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
mvaterlaus
Apprentice
Apprentice


Joined: 01 Oct 2010
Posts: 234
Location: Switzerland

PostPosted: Thu Dec 13, 2012 8:10 am    Post subject: Reply with quote

hi rabcor,
for mounting gpt partitions, you have to turn on support in the kernel for it. read in [1] about it. if you want to examine the partitioning of the harddrive, you can use gfdisk.

[1]http://www.pjc.me.uk/efi-gpt/index.html
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3333
Location: de

PostPosted: Thu Dec 13, 2012 9:31 am    Post subject: Reply with quote

It's easy.
Code:
mount /dev/sdX /path/to/your/mountpoint


:D

Ok, but I guess, that wasn't the thing you wanted to know.

To use GPT, you don't need UEFI or EFI. It works too with every ordinary BIOS.

Steps to do:
  • Enable GPT support in the kernel: General setup -> Enable block layer -> Partition Types -> EFI GUID Partition support
  • Compile grub2 with efi/gpt support (Use-Flag), if you want to boot from such a partition.
  • For boot support, you have to create an extra partition of 2 MiB furthermore, on which you have to set the gpt boot flag. Don't create any file system on it.

cfdisk isn't currently able to handle gpt partitions. fdisk can do it. But properly the easiest way is to use parted/gparted.
Back to top
View user's profile Send private message
gabrielg
Tux's lil' helper
Tux's lil' helper


Joined: 16 Nov 2012
Posts: 134

PostPosted: Thu Dec 13, 2012 11:40 am    Post subject: Reply with quote

If you only need to mount a GPT partition, you just need to enable it in the kernel, partition the disk with parted or similar and mount as you would normally do. You don't need grub2 with EFI or anything like that. However, if you do want GPT and boot with EFI, you can follow musv's steps. EFI boot can be challenging depending on the system, but at least in my experience is way faster.
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Thu Dec 13, 2012 3:07 pm    Post subject: Reply with quote

musv wrote:
cfdisk isn't currently able to handle gpt partitions. fdisk can do it. But properly the easiest way is to use parted/gparted.


The version of fdisk that comes in the util-linux package can't handle GPT disks, at least not as of version 2.21.2 (the latest I've got), and not with whatever build switches I used. That said, there is a program called "GNU fdisk" that's based on libparted and that can therefore handle GPT disks. If it's available in portage I don't know its name; a search on "fdisk" didn't turn it up. IMHO, it's unwise to use this program in place of util-linux's fdisk. The reason is that util-linux's fdisk does a much better job of handling error conditions than does libparted.

IMO, if you want an fdisk-like tool that can handle GPT, your best bet is to install my GPT fdisk package, which is in portage as "gdisk". This includes gdisk and cgdisk, which are modelled on fdisk and cfdisk, respectively; and sgdisk, which is designed for use in scripts and by experts for quick changes. GPT fdisk, like util-linux's fdisk, is not built on libparted, so it gives you an extra path to access the partition table.

To address rabcor's problem, others have pointed out the pre-requisites (most importantly, GPT support in the kernel). If you're sure you've got such support, rabcor, I suggest posting some more diagnostic information, such as:


  • The output of "ls /dev/sd*" (or "ls /dev/hd*" if you happen to be using IDE drivers to access your disks).
  • The output of "dmesg | grep sd[ab]" (changing "[ab]" to "[abc]" or "[abcd]" if you've got more than two disks).
  • The output of "parted /dev/sda print" (changing the device identifier as necessary).
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Thu Dec 13, 2012 5:56 pm    Post subject: Reply with quote

musv wrote:
It's easy.
Code:
mount /dev/sdX /path/to/your/mountpoint


:D

Ok, but I guess, that wasn't the thing you wanted to know.

To use GPT, you don't need UEFI or EFI. It works too with every ordinary BIOS.

Steps to do:
  • Enable GPT support in the kernel: General setup -> Enable block layer -> Partition Types -> EFI GUID Partition support
  • Compile grub2 with efi/gpt support (Use-Flag), if you want to boot from such a partition.
  • For boot support, you have to create an extra partition of 2 MiB furthermore, on which you have to set the gpt boot flag. Don't create any file system on it.

cfdisk isn't currently able to handle gpt partitions. fdisk can do it. But properly the easiest way is to use parted/gparted.


Thanks a lot for that guide, but it seems i have a bit of a problem... i accessed my kernel (the option was btw not in general setup, enable block layer is a menu that can be accessed right from the initiation of menuconfig) and found the option you said i need to activate, it is already turned on along with "Windows Logical Disk Manager (Dynamic Disk) support" which i think is also needed for GPT to work.

On a side note, i don't want to alter my hard drive in any way,i wont need fdisk or any other partition management program to access it, i only want read/write access to the drive. But thanks for the tips anyways ;)


grepping gave me this

Code:
sd 0:0:0:0: [sda] 234441648 512-byte logical blocks: (120 GB/111 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 >
sd 0:0:0:0: [sda] Attached SCSI disk
sd 1:0:0:0: [sdb] 5860533168 512-byte logical blocks: (3.00 TB/2.72 TiB)
sd 1:0:0:0: [sdb] 4096-byte physical blocks
sd 1:0:0:0: [sdb] Write Protect is off
sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00
sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdb: sdb1 sdb2 sdb3
sd 1:0:0:0: [sdb] Attached SCSI disk
sd 2:0:0:0: [sdc] 976773168 512-byte logical blocks: (500 GB/465 GiB)
sd 2:0:0:0: [sdc] Write Protect is off
sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00
sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
 sdc: sdc1
sd 2:0:0:0: [sdc] Attached SCSI disk
EXT2-fs (sda6): error: couldn't mount because of unsupported optional features (240)
EXT4-fs (sda6): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
EXT4-fs (sda6): re-mounted. Opts: (null)
Adding 497976k swap on /dev/sda5.  Priority:-1 extents:1 across:497976k SS
EXT4-fs (sda6): re-mounted. Opts: commit=0


ls /dev/sd gave me this
Code:
sda   sda1  sda2  sda3  sda4  sda5  sda6  sdb   sdb1  sdb2  sdb3  sdc   sdc1

sdb1 being my storage drive's primary partition i would think.

Code:
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  1066kB  1049kB               LDM metadata partition
 2      1066kB  134MB   133MB                Microsoft reserved partition  msftres
 3      134MB   3001GB  3000GB               LDM data partition


seeing this... i'll try changing fstab to try to use sdb3 instead of 1.

Edit: i tried changing fstab to utse sdb3 and sdb2
if i try to mount manually using "mount -t ntfs-3g /dev/sdbX /home/Storage" or the like, i get "the device .... doesn't seem to have a valid NTFS.
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Thu Dec 13, 2012 8:21 pm    Post subject: Reply with quote

rabcor wrote:
i accessed my kernel (the option was btw not in general setup, enable block layer is a menu that can be accessed right from the initiation of menuconfig) and found the option you said i need to activate, it is already turned on along with "Windows Logical Disk Manager (Dynamic Disk) support" which i think is also needed for GPT to work.


Windows LDM ("dynamic disk") support is independent of GPT; as a general rule, the former is not required for the latter. In your case, though....

Quote:
Code:
Model: ATA ST3000DM001-9YN1 (scsi)
Disk /dev/sdb: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name                          Flags
 1      17.4kB  1066kB  1049kB               LDM metadata partition
 2      1066kB  134MB   133MB                Microsoft reserved partition  msftres
 3      134MB   3001GB  3000GB               LDM data partition


It looks like you've got your data in LDM partitions. These are Microsoft's equivalent of Linux LVM partitions, and the filesystems they contain must be mounted in a similar way -- through device files in /dev/mapper, rather than by the raw disk partition numbers. Thus, I recommend you check /dev/mapper to see what files you've got there. That said, I've never used LDM myself, so I'm not sure if you might have to jump through some extra hoops to get LDM to work.
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Fri Dec 14, 2012 3:36 am    Post subject: Reply with quote

Thanks a lot for pointing that out, i'll look into it and see whether i'll find a solution, in the meantime any and all hints and pointers to help me out are appreciated, i'll update once i've tried this LVM or LDM or whatever that is (i don't even know what it is yet so this might take me some time)

Also on a side note, Windows calls this (and only this) hard drive Dynamic (others being basic) if that means something to you other than its just GPT.

Heres what i'm finding out on digging (you don't want to read this unless you're interested in subject)

LDM or Logical Disk Manager is hosted in windows by The MMC-based disk management snap-in (diskmgmt.msc) in woindows (not looking into what that is just yet tho)

Basic storage is well... the standard disk management we're used to, with primary and extended partitions (logical i think its called in linux)

Basic disks can be upgraded to dynamic disks (which i assume i did, after reading about it being actually better than basic) however when that has been done the disk cannot (easily) be downgraded to a basic disk again. To perform a downgrade the hard drive must be re-formatted (erasing all data of course)

Dynamic disks provide the capability for software implementations of RAID. The main disadvantage of this is that they can only be recognized under certain operating systems such as windows 2000 and later. FreeBSD or the Linux kernel starting with version 2.4.8.

It is possible to have 2000 dynamic volumes per disk thanks to the databases stored on the disks but the maximum recommended by microsoft is 32.

on GPT drives they get a dedicated partition to holding metadata whereas MBR disks metadata is stored at the 1MiB area at the end of the disk that is not assigned to any partition. The disk partitioning tools in windows XP will not use that area for disk partitions but the tools in other OS's might (linux anyone?)

May the gods bless wikipedia for providing me with this information. theres more on there but this is all i need for a basic understanding of what i'm dealing with. time to look into the linux equivalent LVM or Logical Volume Manager.

Wikipedia again.

The features of LVM are
Resizing of volume groups online by absorbing new physical volumes or ejecthing existing ones.
Resizing logical volumes online by concatenating extents onto them or truncating extents from them... complicated words.
Create snapshots (read only and read-write) of logical volumes. (LVM1 being read only and LVM2 being read-write)
Mirror whole or parts of logical volumes in a fashion similar to RAID1 (or across multiple PVs in a fashion similar to RAID 0)
Move online logical volumes between PVs
and more.

the most common uses are Managing large hard disk farms by letting you add disks, replace disks or copy and share contents from one disk to another without disrupting service.
On small systems (like home computers) instead of having to estimate at installation time how big a partition might need to be in the future the LVM allows you to resize your disk partitions easily as needed.
Making Backups by taking "snapshots"
Creating single logical volumes of multiple physical volumes or entire hard disks (more simillar to JBOD than RAID0)
One can think of LVM as a thin software layer on top of the ahrd disks and partritions whic creates an illusion of continuity and ease of use for managing hard drive replacement, repartitioning and backup.


Now with basic understanding of the concepts... time to see if i can use that information to my advantage.
_________________
This picture was my biggest reason for ever trying Gentoo <3


Last edited by rabcor on Fri Dec 14, 2012 5:36 am; edited 1 time in total
Back to top
View user's profile Send private message
srs5694
Guru
Guru


Joined: 08 Mar 2004
Posts: 434
Location: Woonsocket, RI

PostPosted: Fri Dec 14, 2012 5:36 am    Post subject: Reply with quote

rabcor wrote:
Thanks a lot for pointing that out, i'll look into it and see whether i'll find a solution, in the meantime any and all hints and pointers to help me out are appreciated, i'll update once i've tried this LVM or LDM or whatever that is (i don't even know what it is yet so this might take me some time)


Start by doing as I said -- look in /dev/mapper for device files. If you see them, try to mount them. If not, that's where you'll need to start digging.

Quote:
Also on a side note, Windows calls this (and only this) hard drive Dynamic (others being basic) if that means something to you other than its just GPT.


Note what I wrote earlier:

srs5694 wrote:
Windows LDM ("dynamic disk") support


In other words, "dynamic disk" is synonymous with "LDM."

As I stated earlier, LDM and GPT are unrelated. LDM can be used on MBR disks, and GPT can be used without LDM. Your disk just happens to use both -- or at least, it seems to, based on the partition labels that parted has shown.
Back to top
View user's profile Send private message
rabcor
Apprentice
Apprentice


Joined: 05 Apr 2012
Posts: 200

PostPosted: Fri Dec 14, 2012 5:39 am    Post subject: Reply with quote

Right so i need to find out how to mount LDM based partitions onto linux and not GPT, thanks for clarifying that.

Allright i'll do what you recommended and try to mount devices in dev/mapper and see what i can find. however first as a precaution i'm gonna do some googling on the subject to be on the safe side.

Yup, doing research i found an old forum post on here (which i had already glanced over while looking for GPT) but it went unsolved. ending with the person accidentally destroying all the data on his hard drive.

Here's a link; https://forums.gentoo.org/viewtopic-t-717208.html

After doing search so far i've found no reports of success with making linux happily allow you to use LDM partitions without any formatting involved. i'll keep looking for a while, but since NeddySeagoon said something among the lines of successfully mounting this would probably destroy all my data on said hard drive, i'd rather not lose 2TB of data...

And as some can imagine, i can't exactly back up 2TB of data at the moment.

I will try reading /usr/src/linux/Documentation/ldm.txt and see what i'll find after some more googling.

Most search is giving me the result that it's simply not possible.

I'm gonna try reading that documentation and then i might try something stupid like creating a new partition on the hard drive and try to mount it through dev/mapper like you suggested and see if all hell breaks loose or not.

It really sucks if linux in the end just can't handle the awesomeness of LDM at this time. I want run linux so bad (worse than ever before, seeing whats coming in 2013, valve's linux based gaming console might change linux's place in the gaming world, and its amount of closed source official drivers, i want nothing more than say goodbye to windows) but formatting my hard drive is gonna be such a major bother... grrr.

The Linux Documentation ( this specific file last update by Anton Altaparmakov on 30 March 2007 for Windows Vista....)
says:"A newer approach that has been implemented with Vista is to put LDM on top of a GPT label disk. This is not supported by the Linux LDM driver yet. (Meaning that my combination of GPT+LDM = Bad)


Also says here that lilo is capable of booting from any of the discovered LDM partitions whereas grub does not understand it (Does grub2 understand LDM or is it just the GPT part i wonder?)

It also says theres more documentation on this subject at http://www.linux-ntfs.org/ where i will now go... only to find out its some crap website owned by some crap company named tuxera or something like that.
_________________
This picture was my biggest reason for ever trying Gentoo <3
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum