General NAS-Central Forums

Welcome to the NAS community
It is currently Mon Nov 20, 2017 7:01 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Jan 22, 2012 11:30 am 
Offline

Joined: Sun Jan 22, 2012 11:26 am
Posts: 4
I've connected NAS HDD to PC with Ubuntu linux.

How can I mount NAS linux partition?
Quote:
sudo mount /dev/sda1 /mnt/nas

tell's me
Quote:
mount: unknown filesystem type 'linux_raid_member'


Top
 Profile  
 
PostPosted: Sun Jan 22, 2012 1:16 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
It's a bit more complicated. The rootfs is assembled in the initramfs. The main actions are this:
Code:
#!/bin/sh
. /common.sh

APPS_IMAGE=sysroot/boot/images/apps
CONFIG_IMAGE=sysroot/boot/images/config
OEM_IMAGE=sysroot/boot/images/oem

mknod /dev/sda b 8 0
mknod /dev/sda1 b 8 1
mknod /dev/sda2 b 8 2

mknod /dev/sdb b 8 16
mknod /dev/sdb1 b 8 17

mknod /dev/md0 b 9 0
BFDDEV=/dev/md0_vg/BFDlv

echo "Checking for valid image in hard drives"
mkdir -p sysroot/boot
vgchange -ay
mount $BFDDEV sysroot/boot -o noatime
do_normal_boot

###
# Normal, platform independent lifeline boot. Mount images
# and set up the rootfs.
###
do_normal_boot()
{
        echo "Found Valid EMC Image in disk..."
        MNTOPTS=loop
        NFSDEBUGMOD=
        NFS_SERVER=
        NFS_ROOT=/home/soho/soho_root

        echo "Mounting apps image..."
        mkdir -p sysroot/mnt/apps
        if [ "$NFSDEBUGMOD" = "" ]
        then   
                mount -o loop,ro $APPS_IMAGE sysroot/mnt/apps
        else
                #for NFS debugging
                enable_network eth0
                echo "mount -t nfs -onolock $NFS_SERVER:$NFS_ROOT sysroot/mnt/apps"
                mount -t nfs -onolock $NFS_SERVER:$NFS_ROOT sysroot/mnt/apps
                sleep 2
        fi

        # mount config
        echo "Mounting config image..."
        losetup /dev/loop1 $CONFIG_IMAGE

        # we temporarily symlink /lib and /usr/lib to the apps image, so we can run
        # the dynamically linked fsck executable from that location in initrd context
        echo "Check config filesystem"
        ln -s /sysroot/mnt/apps/lib /lib
        mkdir -p /usr
        ln -s /sysroot/mnt/apps/usr/lib /usr/lib
        e2fsck -y /dev/loop1 > etc/fsck
        rm -rf /lib /usr/lib /usr

        mkdir -p sysroot/etc
        mount /dev/loop1 sysroot/etc -o noatime,sync

        # mount the branding image if it exists
        if [ -f $OEM_IMAGE ]; then
                mkdir -p sysroot/oem
                mount -o $MNTOPTS sysroot/boot/images/oem sysroot/oem
        fi
}
(This is extracted from /mount_images.sh and /common.sh)

I think in your case the most important part is the vgchange command. Don't know if it's available in bare Ubuntu. Maybe you need to install lvm-tools, or lvm, or lvm2.


Top
 Profile  
 
PostPosted: Sun Jan 22, 2012 4:13 pm 
Offline

Joined: Sun Jan 22, 2012 11:26 am
Posts: 4
I did it.

1) Load Ubuntu live USB (with additional space 512 MB for data)
2) run in terminal
Code:
sudo apt-get mdadm
sudo apt-get lvm2

3) run DiskUtil and start Raid array with button in GUI


Top
 Profile  
 
PostPosted: Mon Oct 15, 2012 7:29 pm 
Offline

Joined: Wed Oct 10, 2012 1:55 pm
Posts: 11
Unfortunately it didn`t happen quite that simple.
I was running Ubuntu 12 liveCD

First note is that it was missing the INSTALL on apt-get. So, it is actually like this:
Code:
sudo apt-get install mdadm
sudo apt-get install lvm2

But even then, when I tried the start Raid, I got the following error:
"not enough components to start".

I noticed the command pvs was not showing my logical volumes right. And even after the:
Code:
sudo mdadm --assemble --scan

my partitions were only visible with
Code:
pvs -a


Then I realized the missing part was (note the root prompt):
Code:
# vgchange -ay


After that:
Code:
# pvs
  PV         VG          Fmt  Attr PSize  PFree
  /dev/md0   md0_vg      lvm2 a-   20.00g    0
  /dev/md1   2e26c579_vg lvm2 a-    2.71t    0

We can see the logical volumes with lvdisplay:
Code:
root@ubuntu:/media/apps/ram/lib# lvdisplay md0_vg
  --- Logical volume ---
  LV Name                /dev/md0_vg/BFDlv
  VG Name                md0_vg
  LV UUID                qTUQ6D-Gqpz-MkD5-31KZ-r87S-j9MS-YacLTz
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.00 GiB
  Current LE             1024
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1
   
  --- Logical volume ---
  LV Name                /dev/md0_vg/vol1
  VG Name                md0_vg
  LV UUID                6mFirc-TJem-wEq6-kyAd-nbD1-VGIF-Hi5lEo
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                16.00 GiB
  Current LE             4095
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2
   
root@ubuntu:/media/apps/ram/lib# lvdisplay 2e26c579_vg
  --- Logical volume ---
  LV Name                /dev/2e26c579_vg/lv1430e500
  VG Name                2e26c579_vg
  LV UUID                Azw2hh-fUtY-odRt-gfiF-tNpa-1f12-F9kmKN
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                2.71 TiB
  Current LE             710269
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0


There they are!!!
So I could finally mount them with:
Code:
mkdir /media/raid0
chmod 777 /media/raid0
mount /dev/md0_vg/BFDlv /media/raid0

mkdir /media/raid1
chmod 777 /media/raid1
mount /dev/md0_vg/vol1 /media/raid1

mkdir /media/raid2
chmod 777 /media/raid2
mount /dev/2e26c579_vg/lv1430e500 /media/raid2


Then I could finally mount the apps partition with:
Code:
cd /media
mkdir apps
chmod 777 apps
mount -o loop,rw /media/raid0/images/apps /media/apps

This is how my mount points showed after all:
Code:
root@ubuntu:/media/apps/ram/lib# df -h
Filesystem                          Size  Used Avail Use% Mounted on
/cow                                496M   97M  399M  20% /
udev                                488M  4.0K  488M   1% /dev
tmpfs                               199M  800K  198M   1% /run
/dev/sr0                            696M  696M     0 100% /cdrom
/dev/loop0                          667M  667M     0 100% /rofs
tmpfs                               496M   72K  496M   1% /tmp
none                                5.0M  4.0K  5.0M   1% /run/lock
none                                496M   80K  496M   1% /run/shm
/dev/mapper/md0_vg-BFDlv            4.0G  1.2G  2.6G  31% /media/raid0
/dev/mapper/md0_vg-vol1             2.8T  1.7T  1.1T  60% /media/raid1
/dev/loop1                          702M  441M  262M  63% /media/apps
/dev/mapper/2e26c579_vg-lv1430e500  2.8T  1.7T  1.1T  60% /media/raid1

I hope it helps!


Top
 Profile  
 
PostPosted: Wed Mar 25, 2015 8:05 pm 
Offline

Joined: Wed Mar 25, 2015 7:33 pm
Posts: 3
hello fgouvea

when I use pvg command I only see

PV VG Fmt Attr PSize PFree
/dev/md126 md0_vg lvm2 a-- 20,01g 0

and cannot see the /dev/md127 (which has the data) can you give to me some clue

Thanks in advance

Luis


Top
 Profile  
 
PostPosted: Tue Oct 13, 2015 11:23 am 
Offline

Joined: Tue Oct 13, 2015 11:21 am
Posts: 1
hi urracaloca,

were you able to recover your data partition?
I have a similar issue. Any help is welcome!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 11 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group