LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-27-2013, 04:07 PM   #1
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Rep: Reputation: 0
Old debian raid mount in ubuntu?


Howdy all,

Let me start of by saying I am new to linux and still learning so please bare with me.

Now my problem.

I used to have debain install on my home server and ive now moved to the xbmc build of ubuntu (xbmcbuntu)
I had a 6TB raid mounted as /home/media on the old debian setup. (which is quite full and I don't want to loss this data (2tbx3 raid 0)) I am waiting on a few more drives to set up raid 5 to be safe but this is a tale for some other day.

Here is my
Code:
fdisk-l
Code:
fdisk -l

Disk /dev/sda: 80.0 GB, 80025280000 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156299375 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: 0x000a9435


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   139526143    69762048   83  Linux
/dev/sda2       139528190   156297215     8384513    5  Extended
/dev/sda5       139528192   156297215     8384512   82  Linux swap / Solaris


Disk /dev/sdb: 2000.4 GB, 2000397852160 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907027055 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: 0x00006463


   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048  3907024895  1953511424   fd  Linux raid autodetect


Disk /dev/sdc: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0003e7d0


   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1            2048  3907028991  1953513472   fd  Linux raid autodetect


Disk /dev/sdd: 2000.4 GB, 2000397852160 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907027055 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: 0x000c4a5b


   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048  3907024895  1953511424   fd  Linux raid autodetect
Can I still use my old raid on ubuntu ?
If so can someone help me out here please as am scared I will mess up and loss all the data on the drives

Cheers
 
Old 05-27-2013, 05:19 PM   #2
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,671

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
As long as you have mdadm installed on Ubuntu (I've a feeling it doesn't come as default) you should be able to mount the RAID as you would a normal disk. With the three drives plugged in they should show up separately and as a volume, probably called md0, which is the one you would mount.
This is assuming this is a purely software RAID.
 
1 members found this post helpful.
Old 05-27-2013, 05:21 PM   #3
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by 273 View Post
As long as you have mdadm installed on Ubuntu (I've a feeling it doesn't come as default) you should be able to mount the RAID as you would a normal disk. With the three drives plugged in they should show up separately and as a volume, probably called md0, which is the one you would mount.
This is assuming this is a purely software RAID.
Thanks but I don't see any md0 in the list above.
 
Old 05-27-2013, 05:36 PM   #4
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,671

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
Check that you have mdadm installed -- I think for some reason Ubuntu doesn't have it installed by default.
If you do have it installed then you may have to run "mdadm --assemble" to reassemble it (See point 7 in the page linked).
http://ubuntuforums.org/showthread.php?t=408461
Usually when I've attached a RAID to a system with mdadm installed I've not had to assemble.
 
1 members found this post helpful.
Old 05-27-2013, 06:09 PM   #5
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by 273 View Post
Check that you have mdadm installed -- I think for some reason Ubuntu doesn't have it installed by default.
If you do have it installed then you may have to run "mdadm --assemble" to reassemble it (See point 7 in the page linked).
http://ubuntuforums.org/showthread.php?t=408461
Usually when I've attached a RAID to a system with mdadm installed I've not had to assemble.
Howdy I mean to for you to do everything but am very new and don't want to lose my data could you help me out step by step? (Sorry)

I got this

Code:
mdadm --assemble
mdadm: an md device must be given in this mode
does that mean it is installed?

Cheers
 
Old 05-27-2013, 06:16 PM   #6
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Hey edit that I did it! WOW lol

I ran

Code:
mdadm --assemble --scan
than

Code:
mount -t auto /dev/md0 /home/media
Thanks!

last question is there a way to make the mount code, auto mount on boot? with ubuntu?
Cheers

Last edited by Vodkaholic1983; 05-27-2013 at 06:21 PM.
 
Old 05-27-2013, 06:17 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,491

Rep: Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090
Two things:

1) If you don't want to lose the data, you should never have set up raid 0 in the first place. Despite its name, it is not "raid", meaning it is not redundant. In fact with a 3-drive raid 0, you're 3 times more likely to lose your data than with a single drive. RAID 0 has ONE use, to make disk I/O faster in applications where speed is critical and the data itself is of little importance.

2) If you don't want to lose the data, you should have been making regular backups since day 1.


You can add the drive to /etc/fstab to get it to mount on boot.

Last edited by suicidaleggroll; 05-27-2013 at 06:20 PM.
 
1 members found this post helpful.
Old 05-27-2013, 06:20 PM   #8
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
Two things:

1) If you don't want to lose the data, you should never have set up raid 0 in the first place. Despite its name, it is not "raid", meaning it is not redundant. In fact with a 3-drive raid 0, you're 3 times more likely to lose your data than with a single drive. RAID 0 has ONE use, to make disk I/O faster in cases where speed critical and the data itself is of little importance.

2) If you don't want to lose the data, you should have been making regular backups since day 1.


You can add the drive to /etc/fstab to get it to mount on boot.
Am am waiting on more drives to add redundance.

Thanks for the fstab info do I just add this

Code:
mount -t auto /dev/md0 /home/media
to the very bottom of that file?
 
Old 05-27-2013, 06:21 PM   #9
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,491

Rep: Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090
Quote:
Originally Posted by Vodkaholic1983 View Post
Am am waiting on more drives to add redundance.

Thanks for the fstab info do I just add this

Code:
mount -t auto /dev/md0 /home/media
to the very bottom of that file?
Google is your friend

http://www.yolinux.com/TUTORIALS/Lin...HardDrive.html
 
Old 05-27-2013, 06:23 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,671

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
Quote:
Originally Posted by Vodkaholic1983 View Post
Hey edit that I did it! WOW lol

I ran

Code:
mdadm --assemble --scan
than

Code:
mount -t auto /dev/md0 /home/media
Thanks!

last question is there a way to make the mount code auto mount on boot? with ubuntu?
Cheers
This:
Quote:
Originally Posted by suicidaleggroll View Post
You can add the drive to /etc/fstab to get it to mount on boot.
I tend to use UUIDs as my drives end up in a funny order so I do this:
Code:
$ ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx 1 root root 10 May 27 15:42 0617293a-1ec1-4185-bfd5-c0510e273203 -> ../../sdg1
lrwxrwxrwx 1 root root 10 May 27 15:42 38b44b1d-a7ca-453a-bd26-4866e3f410a4 -> ../../sdf1
lrwxrwxrwx 1 root root  9 May 27 15:42 3ce1a1eb-caa2-438f-9ae6-0e7be82bc4f8 -> ../../md0
lrwxrwxrwx 1 root root 10 May 27 15:52 46e6f5d6-6556-42ab-97ae-04e87ee36b0f -> ../../sdi1
lrwxrwxrwx 1 root root 10 May 27 15:42 4e053123-83bd-4e4c-8419-858fce992f33 -> ../../sda1
lrwxrwxrwx 1 root root 10 May 27 15:42 bd7e3099-504b-4c11-9776-fa5b0366720c -> ../../sdb1
Then put the UUID in /etc/fstab like this:
Code:
# RAID5, automount
UUID=3ce1a1eb-caa2-438f-9ae6-0e7be82bc4f8 /media/raid     ext4    defaults,noatime        0       2
Of course you would use your UUID and change the ext4 for whichever file system the RAID is using.
 
1 members found this post helpful.
Old 05-27-2013, 06:23 PM   #11
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
Google hates me as it tells me alot of lies but thanks for that so does this look right to you mr roll?

Code:
/dev/md0 /home/media auto defaults 0 0
 
Old 05-27-2013, 06:32 PM   #12
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,491

Rep: Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090
Quote:
Originally Posted by Vodkaholic1983 View Post
Google hates me as it tells me alot of lies but thanks for that so does this look right to you mr roll?

Code:
/dev/md0 /home/media auto defaults 0 0
I would change the auto to the actual filesystem type you're using, but other than that it's fine.

A lot of sites recommend using UUID to reference the drive since the names can re-order as you add/remove drives, but you don't need to worry about this with the raid, so you're fine calling it /dev/md0 like you have.
 
1 members found this post helpful.
Old 05-27-2013, 06:34 PM   #13
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by suicidaleggroll View Post
I would change the auto to the actual filesystem type you're using, but other than that it's fine.

A lot of sites recommend using UUID to reference the drive since the names can re-order as you add/remove drives, but you don't need to worry about this with the raid, so you're fine calling it /dev/md0 like you have.
The raid was ext4

so

Code:
/dev/md0 /home/media ext4 defaults 0 0
And thanks to you two fine people for helping me
 
Old 05-27-2013, 06:40 PM   #14
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 6,671

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
Quote:
Originally Posted by suicidaleggroll View Post
A lot of sites recommend using UUID to reference the drive since the names can re-order as you add/remove drives, but you don't need to worry about this with the raid, so you're fine calling it /dev/md0 like you have.
To be honest the main reason I showed it was because that's how I happen to have things set up. I suppose it's handy to have it set like that if there's the possibility of another RAID being installed, or are RAID names persistent?
 
Old 05-27-2013, 06:52 PM   #15
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,491

Rep: Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090Reputation: 2090
Quote:
Originally Posted by 273 View Post
I suppose it's handy to have it set like that if there's the possibility of another RAID being installed, or are RAID names persistent?
I don't believe they do, set up that way in the mdadm config...but I could be wrong.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian / Ubuntu: how to install a RAID 5 ? frenchn00b Linux - General 4 05-13-2010 09:13 AM
mount existing ntfs SATA RAID 0 on RHEL4 VIA fake RAID tmoble Linux - Hardware 10 11-13-2009 07:49 PM
Mount 1/2 a UFS software RAID-1 on Debian? joemadeus Linux - Hardware 3 12-23-2007 01:10 PM
DELL poweredge 4400 raid machine with debian/ubuntu. taiwf Linux - Hardware 2 12-15-2005 09:11 PM
Mount SATA RAID drives in debian? EcceVery Debian 8 05-12-2004 04:24 PM


All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration