LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Old debian raid mount in ubuntu? (https://www.linuxquestions.org/questions/linux-newbie-8/old-debian-raid-mount-in-ubuntu-4175463656/)

Vodkaholic1983 05-27-2013 04:07 PM

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

273 05-27-2013 05:19 PM

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.

Vodkaholic1983 05-27-2013 05:21 PM

Quote:

Originally Posted by 273 (Post 4960107)
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.

273 05-27-2013 05:36 PM

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.

Vodkaholic1983 05-27-2013 06:09 PM

Quote:

Originally Posted by 273 (Post 4960116)
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

Vodkaholic1983 05-27-2013 06:16 PM

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

suicidaleggroll 05-27-2013 06:17 PM

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.

Vodkaholic1983 05-27-2013 06:20 PM

Quote:

Originally Posted by suicidaleggroll (Post 4960130)
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?

suicidaleggroll 05-27-2013 06:21 PM

Quote:

Originally Posted by Vodkaholic1983 (Post 4960133)
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

273 05-27-2013 06:23 PM

Quote:

Originally Posted by Vodkaholic1983 (Post 4960129)
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 (Post 4960130)
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.

Vodkaholic1983 05-27-2013 06:23 PM

Quote:

Originally Posted by suicidaleggroll (Post 4960134)

Google hates me as it tells me alot of lies :D but thanks for that so does this look right to you mr roll?

Code:

/dev/md0 /home/media auto defaults 0 0

suicidaleggroll 05-27-2013 06:32 PM

Quote:

Originally Posted by Vodkaholic1983 (Post 4960137)
Google hates me as it tells me alot of lies :D 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.

Vodkaholic1983 05-27-2013 06:34 PM

Quote:

Originally Posted by suicidaleggroll (Post 4960142)
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 :)

273 05-27-2013 06:40 PM

Quote:

Originally Posted by suicidaleggroll (Post 4960142)
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?

suicidaleggroll 05-27-2013 06:52 PM

Quote:

Originally Posted by 273 (Post 4960146)
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.


All times are GMT -5. The time now is 10:40 AM.