2nd hdd is Linux_lvm can't mount MBR on BSD with GPT


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 04-14-2016
2nd hdd is Linux_lvm can't mount MBR on BSD with GPT

rying it this way, because I can't handle the slices for the second hdd. If there is someone on this forum who can help me out of that misery, he would really save my digital life in this digital ocean.

So not giving up, reading several times the manual of gpart. But the best hint in all that was to create a second boot-sector on the the 2nd hdd or even replace the MBR which is there. In other words, the boot-disk has got a GPT boot partition, that probably will only communicate with another hdd that works as well with the GPT. But my second disk has got a MBR.
This would mean (as far as I understood the whole /boot folder) to manipulate the loader.conf.pcbsd which I already did once and ended up in a /etc/fstab with another line that froze all rebooting. Not to write anything into the loader.conf file and nothing in the loader.conf.pcbsd.
I tried several times to add on the GUI (using Mate-Desktop) the widget to perform the adding of another slice on the second disk. The file format proposed there was linux-lvm. But this did not work at all. The disk is there, but I can't access it.
The only thing I removed from the fresh installation was in
Code:
 /var/run

the
Code:
 sudo

. So please think whatever you want about the removal of sudo, but I got a better experience without it.
So posting here the output for
Code:
 gpart show 
=>       34  976773101  ada0  GPT  (466G)
         34       2048     1  bios-boot  (1.0M)
       2082          6        - free -  (3.0K)
       2088  972558336     2  freebsd-zfs  (464G)
  972560424    4194304     3  freebsd-swap  (2.0G)
  976754728      18407        - free -  (9.0M)

=>        63  1953525105  ada1  MBR  (932G)
          63        1985        - free -  (993K)
        2048  1953521664     1  linux-lvm  (932G)
  1953523712        1456        - free -  (728K)

=>      1  1888767  da0  MBR  (3.6G)
        1       14       - free -  (28K)
       15  1888753    1  fat32  (3.6G)

Looking up in /boot the kernel module for
Code:
 geom_linux_lvm.ko

is there. As well looking up in
Code:
 /var/run/dmesg.boot

The next best thing or the closest I came to add another slice to the second disk, and another boot sector was the following.
Code:
#gpart create -s GPT ada1
#gpart add    -t freebsd-ufs -a 1 ada1

This last one I did. Nothing happens to mount the device or slice.

By chance there is the GUI of KDE to look at the slices of the 2nd hdd, that tells me
first slice is free, starting at sector 63 ending at sector 1985, as shown above, and as well another free slice that starts at 2048. Both free slices have got a size about 992 KB the first and the second about 728KB.
So reading again and again even writing it down to understand it, I learned that there should be another GPT slice on the second disk replacing the MBR record. But any time I try so to slice the first entry to be or freebsd, linux-lvm or even linux-data I can't mount it due to an invalid argument.
Quote "An error was detected while executing 'mount': /dev/ada1s1 Invalid argument. Trying to mount it on "/" or the only user.

so, if by chance there is some expert of this who can help me I'd really gladfully appreciate it . Loads of thanks in advance, if someone has mercy on me.

After reading and searching a while I got this far >

Step one: using gparted on another linux machine deleting and formatting the usb-key with the late debian-boot and live system on. Putting this newly formatted usb-key into the bsd machine I still see three slices, just like it would be a bsd scheme. There is even the iso-name and the hash-key as name of the stripe. I did not work with gparted to format this usb-key as one volume. There are three devices remaining.
Step two: reading in wiki, linux is crawling under the hood of bsd and using the kernel. Using bsd GEOM means to mount a RAID 0. But I never intended do use a raid something, nor RAID 0 or RAID 1 or 5. But it is installed to speed things up, on a one disk machine. Great, I always yearned for that. And by the way beeing a software raid, it is slowing down the cpu speed for very simple file transfers, jampacking the bus.
Step three: URE (unrecoverable read error), the different size of arrays may cause some problems when two different disks or more have to work whith each other. Depending of the usage, the type and the age of your disk, your next update or upgrade can be a real challenge. It does not matter what linux or unix you will use. You will get a RAID 0 without beeing asked.
Step four: onboard tools just like LVM will help me to take control of the size of the device. Well, I still struggle to do so.
Step five: The FreeBSD Project is telling about this topic, how to manipulate the
Code:
/etc/fstab

to mount automatically the 2nd hdd on booting up like this

Code:
 
# mkdir /stripe
# echo "/dev/stripe/st0a /stripe ufs rw 2 2" \ 
    >> /etc/fstab

in my case it would replace the MBR on the second hdd with GPT and a the same time changing the linux_lvm to ufs.

and to

Code:
 # echo 'geom_stripe_load="YES"' >> /boot/loader.conf

That includes the
geom_stripe.ko module is loaded. Have a call at your local kernel bakery. It is loaded.
If nothing else works, there is a workaround to undo your fatal erros, to recover the data, which I doubt.
Step six: I may recover the data via an external usb-hdd on another machine and create a new partition. This implies I'd rather work with that small boot-disk and several external usb-hdd to avoid that fuss. As if way back, the floppy and CD is beeing replaced by external usb-hdd.

Step seven: using the usb-key to copy files takes a long long time, just 200 MB or 6 GB, from the disk to the key and vice versa. Caja gives me time for a walk, on a dual-core laptop, quad-core Desktop, anyway. Never before I have seen something that slow on any older machine with less RAM or a slower CPU. Beside it is no help to wipe out gvfsd-metadata. Things are going very slow.
I am hoping to save some content before doing something wrong beeing blocked after adding a line to /etc/fstab
Step eight: adding a line to rc.conf
Code:
 linux_lvm_enable="YES"

and rebooting makes it really slow to reboot. Still the 2nd hdd is out of reach, I can't access it.
Step eight: adding
Code:
 linux_lvm_load="YES"

to /boot/loader.conf
Step nine: waiting a while to reboot and daring to add a line to the fstab file. The very one mentioned above. This will take more time, because file transfers back and forth is really slow, using a single usb-key. And I don't want to loose some fresh 50GB again.

My good old notch external hdd saved my data, much faster than the usb-key. I never saw any usb-key transferring data at 230 kB/s. Until now I tried any other hint, but not daring to mess around with /etc/fstab again.
As follows the commands that did not help, even coming from 17.2.*Adding Disks
Code:
# gpart create -s GPT ada1
gpart: geom 'ada1': File exists

(I know, should I create ada2?)

Code:
# gpart add -t freebsd-ufs -a 1M ada1
gpart: size '0': Invalid argument

( so what size else?)

Code:
newfs -U /dev/ada1p1
newfs: /dev/ada1p1: could not find special device

following the last step on this page, I am sure to end up reinstalling it all over again. Being up and down, from dusk to dawn, looking all the commands and hints that can be found (wrong magic number 0 (expecting 00xef53), looking for bad blocks, using fsck which of course doesn't work, because the device is not there to be seen or can not be accessed. Tried also

Code:
/var/run/dmesg.boot
diskinfo -ctv ada1
gpart set -a active /dev/ada1 
    operation not supported by device
gpart set -a bootme -i 1 /dev/ada1
    invalid argument

So the very last step, with little hope to succeed is to change the
Code:
/etc/fstab

Code:
#mkdir /stripe
#echo "/dev/stripe/ada1s1  /stripe/ufs rw 2 2 " \ >> /etc/fstab

So wish me luck, the moment of truth has come to reboot.
like this as seen on bsd.org

Befort rebooting I added the following line

Code:
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ada1

followed by
Code:
bootcode written to ada1

After rebooting I do not even see now what is going on.
But the /etc/fstab remains the same, beside this I had to fuddle around in the boot menu which way to start, single user, verbose, or something like post-installing. Now the 2nd hdd is seen as a SCSI device, unknown and three slashes as a location, thats wrong. It is a SATA2 disk. And it is still out of reach. When trying to do this in the GUI of Systemcontrol to mount the second disk on the mountpoint /home/username
I am told there was an error detected
Code:
while executing 'mount' /dev/ada1s1: invalid argument

Nice. Very nice.


linux-lvm and zfs don't work together, ext. hdd helped.
So after losing already the content, I solved it via the external hdd installing the system many times over and over again, lets say, the hard way, on the first physical hdd. But it did not work to mount the second internal hdd. So I changed it to mount the system on the physical second hdd and by chance GRUB remained on the old first one. This means by booting it, I need to change the boot sequence every time in the BIOS, but now I can access the second hdd as root. All done without even having added one bit to /etc/fstb and reading about this recently solved problem on both sides, the GNU-Project and ZFS licence problems.

Last edited by 1in10; 05-22-2016 at 03:17 AM.. Reason: [solved] linux-lvm and zfs don't work together, ext. hdd helped and GRUB on the new old one
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Fstab for 2nd hdd, how to? 1in10 Fedora 6 04-06-2016 08:50 PM
How to mount ntfs for storage HDD new to Solaris 11.2? userx-bw Solaris 2 06-12-2015 08:39 PM
GPT Partitions derekludwig Red Hat 4 11-27-2014 12:22 PM
IBM AIX Internal HDD vs SAN HDD and Oracle filosophizer AIX 7 01-27-2014 05:33 AM
Dd (raw) image of SCO 5.0.6 mount as second hdd OrangeKenny SCO 4 04-01-2013 09:46 AM
Disk Paritioning Scheme--GPT or MBR mojoman Fedora 3 09-21-2012 03:13 AM
USB mount of Free BSD Junaid Subhani BSD 3 09-01-2012 03:29 PM
GPT/Protective MBR problem... Blackbird Boot Loaders 3 11-10-2010 10:10 AM
Old HDD copy to new HDD ? im lost... Chevy89rocks UNIX for Dummies Questions & Answers 5 02-20-2009 02:23 AM
How to mount and read vintage scsi HDD 82026 Filesystems, Disks and Memory 1 12-05-2008 07:00 AM
Sco 5.06 How To Mount A 2nd Hdd Help Help!!!! josramon SCO 4 10-22-2008 06:06 AM
NFS HDD mount on Windows XP severt Windows & DOS: Issues & Discussions 1 05-30-2008 10:01 AM
How to mount External HDD in VMware 6.0 1409.venkatesh Solaris 0 04-09-2008 11:32 AM
dual boot solaris off of 2nd HDD dangral UNIX for Dummies Questions & Answers 3 11-21-2002 09:45 AM
backup command that will send e-mail to mount 2nd tape mvilla0993 UNIX for Advanced & Expert Users 1 06-14-2002 03:24 PM