Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have a macbook ssd taken from a damaged macbook laptop which is connected to a usb adaptor and i need to read the ssd in fedora 26. /ls /dev/sd* shows the drive as /dev/sdb.
I tried to mount the drive with: mount -t hfsplus /dev/sdb /mnt
but got error: mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.
is there a way to read the contents of this drive in fedora 26?
I have a macbook ssd taken from a damaged macbook laptop which is connected to a usb adaptor and i need to read the ssd in fedora 26. /ls /dev/sd* shows the drive as /dev/sdb.
I tried to mount the drive with: mount -t hfsplus /dev/sdb /mnt
but got error: mount: /mnt: wrong fs type, bad option, bad superblock on /dev/sdb, missing codepage or helper program, or other error.
is there a way to read the contents of this drive in fedora 26?
You say it's a damaged Macbook, and the drive is giving you mount errors. Since you obviously have the hfs tools loaded, chances are the drive is damaged/dead
I have a macbook ssd taken from a damaged macbook laptop which is connected to a usb adaptor and i need to read the ssd in fedora 26. /ls /dev/sd* shows the drive as /dev/sdb.
I tried to mount the drive with: mount -t hfsplus /dev/sdb /mnt
Typically you don't mount drives, you mount the partitions in the drive. Below are my old notes. They are for a drive image but you should be able to figure it out.
Code:
STEPS FOR MOUNTING PARTITION OF IMAGE.DD FILE FROM IN SAME DIRECTORY AS ROOT OR SUDO:
1: mkdir /mnt/image
2: sfdisk -l -uS image.dd
3: mount -oloop,offset=32256 image.dd /mnt/image
OFFSET = Sectors offset of beginning sector of partition multiplied by 512, in this case the first partition starts at offset 63.
To mount hfs or hfsplus, modprobe them first before mounting. Have hfsplus,
hfsutils, hfsutils-tcltk installled
@brains thankyou for your feedback however I'm unable to figure it out. I think I'm supposed to create a backup of the macbook drive to a file called imange.dd but I don't know how to do this. What software does one use? My only experience of disk backups is clonezilla and acronis. Thanks for any further advice.
@jefro thanks however the data at the link you gave refers to sdXY but I only have sdX. Plus there's no hfsprogs avalable for fedora 26.
And you're very welcome for the advice I gave too, tonj. In your first post, you indicated that you DO have the HFS utilities loaded, when you tried to mount it using the hfs filesystem type.
If you looked in the Fedora repos, you'd find the hfsutils package: https://admin.fedoraproject.org/pkgd...rpms/hfsutils/ Install it THEN try to mount it, because until you do, you don't have what you need to mount it. And AGAIN I'll say that if the laptop was damaged to start with (and you're not even seeing any partitions), then chances are the DRIVE IS ALSO DAMAGED and you can't mount it anyway.
And since the backup your supposed to create has a .dd extension, that probably means you should use the "dd" utility.
@brains thankyou for your feedback however I'm unable to figure it out. I think I'm supposed to create a backup of the macbook drive to a file called imange.dd but I don't know how to do this. What software does one use? My only experience of disk backups is clonezilla and acronis. Thanks for any further advice.
The mount command you posted shows you tried to mount /dev/sdb
This is the entire drive, you cannot mount that way, it has to be a partition in the drive which would be: /dev/sdb1 for the first parition, /dev/sdb2 would be the second partition, there needs to be a number after the letter b.
If the output of command: fdisk -l only shows the drive (/dev/sdb) and no partitions (/dev/sdb1), means there may be some mbr damage, the mbr (Master boot record) contains the partition information, this does not mean it is toast, you can still attempt to mount the partition if you can find the first sector of any partition in the drive, most often the first sector of the first partition was at sector 63.
In the past when I worked on hfs or hfsplus drives, I had to load the appropriate kernel modules, because I was using linux, hfs driver/modules are not loaded by default when you boot up the linux machine, hence the "modprobe them first" in my notes. This could be different today, you need to check if these drivers are being loaded when the drive is plugged in, if not you have to load them manually to access the hfs/hfsplus file systems from linux.
Code:
mkdir /mnt/image
sfdisk -l -uS /dev/sdb
mount -oloop,offset=32256 /dev/sdb /mnt/image
mount -t hfsplus -oloop,offset=32256 /dev/sdb /mnt/image
I modified my notes in the code box above to reflect your drive, these commands may need to be done as root or sudo. The first command makes a directory to mount the drive called image, the second command will show exact first and last sectors of all partitions. The third command mounts the first partition if it is at sector 63, how I derived the offset is explained in my first post. If command number 2 does not return absolute results, means the mbr is corrupt, but the partitions are likely still intact, so I would attempt mounting using the third or forth command anyway as typically this would be where the first sector is for mbr data drives. The forth command specifies the file system type, I don't think this is required if hfsplus module/driver is loaded to the kernel, but if command 3 don't work, it's worth a try.
If command 2 or command fdisk -l does not show partition information, you can install a small utility called sleuthkit and then run the mmls command that has been very successful for me in pulling out that information. Example: mmls -t mac /dev/sdb
Sleuthkit was designed with forensics in mind and has lots of wonderful utilities for digging out what you're after even if you tried to hide information from the law.
In short:
Make sure hfs/hfsplus drivers loaded onto kernel
Mount partitions, not drives
Make an image of the entire drive and do all this stuff on the image, that is the forensically safe method to avoid data loose. That is why my notes refer to image of a drive.
If everything is good with the drive, hfs and hfsplus utilities installed, drive plugged in before bootup, it should be spotted and appropriate modules will load, possibly auto mounted by the time FC is finished booting. Mac drive should be efi, not mbr.
I think the drive is damaged.
# ls /dev/sd* gives
/dev/sda /dev/sda1 /dev/sda2 /dev/sdb
/dev/sdb is the macbook drive.
fdisk -l only gives info about /dev/sda - the main (internal) hard drive. It doesn't mention /dev/sdb at all.
sfdisk -l -uS /dev/sdb gives
sfdisk: cannot open /dev/sdb: No such file or directory
and yet ls/dev/sd* shows it.
I've rebooted the machine with the macbook drive connected. update: I've also tried running testdisk and that doesn't even list the drive.
...which is exactly what you were told in my first reply, wasn't it? And you're very welcome again for pointing you to toe hfs utilities for F26, too.
REMEMBER
Just because the linux utilities cannot read the partition information, does not mean the partitions don't exit. It is simply a matter of finding the first sector of the partitions that were there. If you really want to access this drive, it is still possible.
You can always hit some Mac forums and ask someone to post the default drive layout for the exact same make and model of Macbook, then use the mount with offset example I posted, make sure to do the proper calculations. This unit can't be that old because the drive is an ssd, someone out there is running it right now. I have found partitions the hard way, by going sector by sector. I typically don't give up if time is irrelevant.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.