jostar
February 1st, 2013, 12:32 PM
Hi, I'm new to Ubuntu and am trying to setup my N40L using 250GB as OS plus 2x2TB as RAID 1 for data. However am running into problem during toward the second half of installation.
A brief summary of what I have done.
N40L running single 250GB HD (/dev/sdc), created bootable USB and install Ubuntu to the single 250GB HD using all default settings. Everything was straight forward, also managed to install Samba and worked perfectly.
Shut down computer, then install 2x2TB drives, start up computer.
Installed GParted, can see the new drives (/dev/sda & /dev/sdb). In Gparted, formatted to ntfs. I know that ntfs may not be the best format, but was keeping my option open just in case I want to turn the N40L into a HTPC and I may need to put windows in it.
All seems ok and ventured into terminal.
sudo mdadm --create --name=raidarray --verbose /dev/md1 --raid-devices=2 --level=1 /dev/sda1 /dev/sdb1
md1 seems to have created successfully, then
sudo mdadm --detail /dev/md1
I suppose that initialised the array, off for the night. The next day, booted up the computer realising md1 is now md127 and read only, googled it and rectify with following:
sudo mdadm --stop /dev/md127
sudo mdadm --assemble --verbose /dev/md1 --level=1 /dev/sda1 /dev/sdb1
then amended mdadm.conf
sudo update-initramfs -u
At this point I have not restarted the machine to test if the array would remain after the boot and I ran into my currect problem after I did
sudo fdisk -l
and this is what I got
Disk /dev/sda: 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: 0x00018e6e
Device Boot Start End Blocks Id System
/dev/sda1 2048 3907028991 1953513472 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 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: 0x00080f77
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 7 HPFS/NTFS/exFAT
Disk /dev/md1: 2000.3 GB, 2000263380992 bytes
2 heads, 4 sectors/track, 488345552 cylinders, total 3906764416 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: 0x00000000
Disk /dev/md1 doesn't contain a valid partition table
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x000dd73b
Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 499711 248832 83 Linux
/dev/sdc2 501758 488396799 243947521 5 Extended
/dev/sdc5 501760 488396799 243947520 8e Linux LVM
Disk /dev/mapper/ubuntu-root: 243.5 GB, 243491930112 bytes
255 heads, 63 sectors/track, 29602 cylinders, total 475570176 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: 0x00000000
Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table
Disk /dev/mapper/ubuntu-swap_1: 6304 MB, 6304038912 bytes
255 heads, 63 sectors/track, 766 cylinders, total 12312576 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: 0x00000000
Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition tableI seems that I am missing partition tables left right and centre, attempted to to fix the array first, did a lot of googling. and tried
sudo e2fsck -cc /dev/md1
e2fsck 1.42.5 (29-Jul-2012)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/md1
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>So didn't work, read somewhere else and suggested this:
sudo mkfs.ntfs /dev/md1
At least now it says NTFS volume structure completed, but then when I fdisk again
Disk /dev/sda: 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: 0x00018e6e
Device Boot Start End Blocks Id System
/dev/sda1 2048 3907028991 1953513472 fd Linux RAID autodetect
Disk /dev/sdb: 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: 0x00080f77
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 fd Linux RAID autodetect
Disk /dev/md1: 2000.3 GB, 2000263380992 bytes
2 heads, 4 sectors/track, 488345552 cylinders, total 3906764416 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: 0x2052474d
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/md1p1 ? 6579571 1924427647 958924038+ 70 DiskSecure Multi-Boot
Partition 1 does not start on a physical sector boundary.
/dev/md1p2 ? 1953251627 3771827541 909287957+ 43 Unknown
Partition 2 does not start on a physical sector boundary.
/dev/md1p3 ? 225735265 225735274 5 72 Unknown
Partition 3 does not start on a physical sector boundary.
/dev/md1p4 2642411520 2642463409 25945 0 Empty
Partition table entries are not in disk order
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x000dd73b
Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 499711 248832 83 Linux
/dev/sdc2 501758 488396799 243947521 5 Extended
/dev/sdc5 501760 488396799 243947520 8e Linux LVM
Disk /dev/mapper/ubuntu-root: 243.5 GB, 243491930112 bytes
255 heads, 63 sectors/track, 29602 cylinders, total 475570176 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: 0x00000000
Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table
Disk /dev/mapper/ubuntu-swap_1: 6304 MB, 6304038912 bytes
255 heads, 63 sectors/track, 766 cylinders, total 12312576 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: 0x00000000
Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition At least now /dev/sdb1 & /dev/sdc1 are showing as Linux RAID! But md1 has got 4 partitions, and it doesn't even look like a partition table? Another thing is when I go into GParted now, both /dev/sdb1 & sdc1 can not be reckonised and file system says 'unknown'. I think I have stuffed it up pretty badly.
So I did more google, someone suggested to do a clean reinstall of the RAID by wiping the array and start over, build the array first and then format. What are the steps and commands to do that including wiping the array?
Another question is fdisk also showing /dev/mapper/ubuntu-root and /dev/mapper/ubuntu-swap_1 don't have a valid partition either. Is that something I need to worry about?
Sorry for the long post, any help is much appreciated.
A brief summary of what I have done.
N40L running single 250GB HD (/dev/sdc), created bootable USB and install Ubuntu to the single 250GB HD using all default settings. Everything was straight forward, also managed to install Samba and worked perfectly.
Shut down computer, then install 2x2TB drives, start up computer.
Installed GParted, can see the new drives (/dev/sda & /dev/sdb). In Gparted, formatted to ntfs. I know that ntfs may not be the best format, but was keeping my option open just in case I want to turn the N40L into a HTPC and I may need to put windows in it.
All seems ok and ventured into terminal.
sudo mdadm --create --name=raidarray --verbose /dev/md1 --raid-devices=2 --level=1 /dev/sda1 /dev/sdb1
md1 seems to have created successfully, then
sudo mdadm --detail /dev/md1
I suppose that initialised the array, off for the night. The next day, booted up the computer realising md1 is now md127 and read only, googled it and rectify with following:
sudo mdadm --stop /dev/md127
sudo mdadm --assemble --verbose /dev/md1 --level=1 /dev/sda1 /dev/sdb1
then amended mdadm.conf
sudo update-initramfs -u
At this point I have not restarted the machine to test if the array would remain after the boot and I ran into my currect problem after I did
sudo fdisk -l
and this is what I got
Disk /dev/sda: 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: 0x00018e6e
Device Boot Start End Blocks Id System
/dev/sda1 2048 3907028991 1953513472 7 HPFS/NTFS/exFAT
Disk /dev/sdb: 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: 0x00080f77
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 7 HPFS/NTFS/exFAT
Disk /dev/md1: 2000.3 GB, 2000263380992 bytes
2 heads, 4 sectors/track, 488345552 cylinders, total 3906764416 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: 0x00000000
Disk /dev/md1 doesn't contain a valid partition table
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x000dd73b
Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 499711 248832 83 Linux
/dev/sdc2 501758 488396799 243947521 5 Extended
/dev/sdc5 501760 488396799 243947520 8e Linux LVM
Disk /dev/mapper/ubuntu-root: 243.5 GB, 243491930112 bytes
255 heads, 63 sectors/track, 29602 cylinders, total 475570176 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: 0x00000000
Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table
Disk /dev/mapper/ubuntu-swap_1: 6304 MB, 6304038912 bytes
255 heads, 63 sectors/track, 766 cylinders, total 12312576 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: 0x00000000
Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition tableI seems that I am missing partition tables left right and centre, attempted to to fix the array first, did a lot of googling. and tried
sudo e2fsck -cc /dev/md1
e2fsck 1.42.5 (29-Jul-2012)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/md1
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>So didn't work, read somewhere else and suggested this:
sudo mkfs.ntfs /dev/md1
At least now it says NTFS volume structure completed, but then when I fdisk again
Disk /dev/sda: 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: 0x00018e6e
Device Boot Start End Blocks Id System
/dev/sda1 2048 3907028991 1953513472 fd Linux RAID autodetect
Disk /dev/sdb: 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: 0x00080f77
Device Boot Start End Blocks Id System
/dev/sdb1 2048 3907028991 1953513472 fd Linux RAID autodetect
Disk /dev/md1: 2000.3 GB, 2000263380992 bytes
2 heads, 4 sectors/track, 488345552 cylinders, total 3906764416 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: 0x2052474d
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/md1p1 ? 6579571 1924427647 958924038+ 70 DiskSecure Multi-Boot
Partition 1 does not start on a physical sector boundary.
/dev/md1p2 ? 1953251627 3771827541 909287957+ 43 Unknown
Partition 2 does not start on a physical sector boundary.
/dev/md1p3 ? 225735265 225735274 5 72 Unknown
Partition 3 does not start on a physical sector boundary.
/dev/md1p4 2642411520 2642463409 25945 0 Empty
Partition table entries are not in disk order
Disk /dev/sdc: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 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: 0x000dd73b
Device Boot Start End Blocks Id System
/dev/sdc1 * 2048 499711 248832 83 Linux
/dev/sdc2 501758 488396799 243947521 5 Extended
/dev/sdc5 501760 488396799 243947520 8e Linux LVM
Disk /dev/mapper/ubuntu-root: 243.5 GB, 243491930112 bytes
255 heads, 63 sectors/track, 29602 cylinders, total 475570176 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: 0x00000000
Disk /dev/mapper/ubuntu-root doesn't contain a valid partition table
Disk /dev/mapper/ubuntu-swap_1: 6304 MB, 6304038912 bytes
255 heads, 63 sectors/track, 766 cylinders, total 12312576 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: 0x00000000
Disk /dev/mapper/ubuntu-swap_1 doesn't contain a valid partition At least now /dev/sdb1 & /dev/sdc1 are showing as Linux RAID! But md1 has got 4 partitions, and it doesn't even look like a partition table? Another thing is when I go into GParted now, both /dev/sdb1 & sdc1 can not be reckonised and file system says 'unknown'. I think I have stuffed it up pretty badly.
So I did more google, someone suggested to do a clean reinstall of the RAID by wiping the array and start over, build the array first and then format. What are the steps and commands to do that including wiping the array?
Another question is fdisk also showing /dev/mapper/ubuntu-root and /dev/mapper/ubuntu-swap_1 don't have a valid partition either. Is that something I need to worry about?
Sorry for the long post, any help is much appreciated.