LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



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

Rep: Reputation: 0
auto mount HDD on reboot? ubuntu


Howdy how can this drive to mount on every reboot?
(ubuntu)
mount /dev/md0 /Media

Thanks
 
Old 09-05-2013, 01:57 PM   #2
casualfred
Member
 
Registered: Aug 2012
Location: USA
Distribution: Slackware 14.1
Posts: 73

Rep: Reputation: 15
This will involve editing your /etc/fstab file as root. First, I would figure out that disk's UUID (a unique 32 digit number given to each drive) by looking in /dev/disk/by-uuid:
Code:
$ cd /dev/disk/by-uuid
That folder contains links to your different disk drives according to their UUID. To see what drives each link goes to, just type:
Code:
$ ls -l
Whichever one points to /dev/md0 is the UUID you want to write down.

Now open up /etc/fstab as root in your editor and add this line, BUT using your actual UUID and file system type (this one's an example):
Code:
UUID=3e6be9de-8139-11d1-9106-a43f08d823a6	/Media	ext4	defaults	0	0
Remember to replace the UUID and file system type with the right ones.
I would read the man page for fstab if you need more specifics:
Code:
$ man fstab
Hope this helps!
 
Old 09-05-2013, 02:26 PM   #3
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by casualfred View Post
This will involve editing your /etc/fstab file as root. First, I would figure out that disk's UUID (a unique 32 digit number given to each drive) by looking in /dev/disk/by-uuid:
Code:
$ cd /dev/disk/by-uuid
That folder contains links to your different disk drives according to their UUID. To see what drives each link goes to, just type:
Code:
$ ls -l
Whichever one points to /dev/md0 is the UUID you want to write down.

Now open up /etc/fstab as root in your editor and add this line, BUT using your actual UUID and file system type (this one's an example):
Code:
UUID=3e6be9de-8139-11d1-9106-a43f08d823a6	/Media	ext4	defaults	0	0
Remember to replace the UUID and file system type with the right ones.
I would read the man page for fstab if you need more specifics:
Code:
$ man fstab
Hope this helps!
Awesome thanks I got this

Code:
lrwxrwxrwx 1 root root 11 Sep  5 16:36 df82a52a-8b91-4b73-be81-8b0c4644b100 -> .
So I would add this to the fstab

Code:
UUID=df82a52a-8b91-4b73-be81-8b0c4644b100	/Media	ext4	defaults	0	0
?

Thanks for the reply
 
Old 09-05-2013, 02:47 PM   #4
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
you might want to set a fsck on that drive, since it is ext4

from man fstab
Code:
     The sixth field (fs_passno).
              This field is used by the fsck(8) program to determine the order in  which  filesystem  checks  are
              done  at  reboot  time.   The  root filesystem should be specified with a fs_passno of 1, and other
              filesystems should have a fs_passno of 2.  Filesystems within a drive will be checked sequentially,
              but  filesystems on different drives will be checked at the same time to utilize parallelism avail‐
              able in the hardware.  If the sixth field is not present or zero, a value of zero is  returned  and
              fsck will assume that the filesystem does not need to be checked.
 
Old 09-05-2013, 06:11 PM   #5
casualfred
Member
 
Registered: Aug 2012
Location: USA
Distribution: Slackware 14.1
Posts: 73

Rep: Reputation: 15
Great! Yeah, that looks right. Like Firerat said, you could set the last number on the right to 2 instead of 0. That way, fsck can check it for errors when it mounts it. Let us know if it works alright!

By the way, that UUID link ought to be pointing to -> /dev/md0 hopefully.
 
Old 09-07-2013, 11:08 AM   #6
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Thanks it seems to be working thanks everyone
 
Old 09-24-2013, 05:39 PM   #7
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Howdy, Ive switched to onboard raid now and will this still work the same as then I ls -l I don't see the HDD

Code:
 ls -l
total 0
lrwxrwxrwx 1 root root 10 Sep 24 22:19 632605f3-6152-4551-bd22-c60db36d7469 -> ../../sdd1
lrwxrwxrwx 1 root root 10 Sep 24 22:19 a185eed9-c75d-49fe-a0bb-7316d2ac2712 -> ../../sdd5
fdisk -l

Code:
fdisk -l

WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sda: 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: 0x00000000

Disk /dev/sda doesn't contain a valid partition table

WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdb: 2000.4 GB, 2000397852160 bytes
256 heads, 63 sectors/track, 242251 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: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  3907027054  1953513527   ee  GPT

WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.


Disk /dev/sdc: 2000.4 GB, 2000397852160 bytes
256 heads, 63 sectors/track, 242251 cylinders, total 3907027055 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

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1               1  3907027054  1953513527   ee  GPT
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/isw_bfgcdiefea_Media: 6001.2 GB, 6001185521664 bytes
255 heads, 63 sectors/track, 729602 cylinders, total 11721065472 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 131072 bytes / 393216 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/isw_bfgcdiefea_Media doesn't contain a valid partition table

Disk /dev/sdd: 150.0 GB, 150038863360 bytes
255 heads, 63 sectors/track, 18241 cylinders, total 293044655 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: 0x00086df9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048   284657663   142327808   83  Linux
/dev/sdd2       284659710   293044223     4192257    5  Extended
/dev/sdd5       284659712   293044223     4192256   82  Linux swap / Solaris
Cheers
 
Old 09-25-2013, 01:40 AM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian Jessie / sid
Posts: 1,471

Rep: Reputation: 444Reputation: 444Reputation: 444Reputation: 444Reputation: 444
since it is gpt, use parted instead of fdisk

Code:
parted -l
( as root )
 
Old 09-25-2013, 07:08 AM   #9
Vodkaholic1983
Member
 
Registered: May 2010
Distribution: Windows / Debian
Posts: 163

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Firerat View Post
since it is gpt, use parted instead of fdisk

Code:
parted -l
( as root )
Ah I see, I got this from the code you wrote.

Code:
parted -l
Error: /dev/sda: unrecognised disk label

Error: /dev/sdb: unrecognised disk label

Error: /dev/sdc: unrecognised disk label

Model: ATA WDC WD1500HLFS-0 (scsi)
Disk /dev/sdd: 150GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size    Type      File system     Flags
 1      1049kB  146GB  146GB   primary   ext4            boot
 2      146GB   150GB  4293MB  extended
 5      146GB   150GB  4293MB  logical   linux-swap(v1)


Model: Linux device-mapper (striped) (dm)
Disk /dev/mapper/isw_bfgcdiefea_Media: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  6001GB  6001GB  ext4
 
  


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
Hardware RAID refuses to auto mount after reboot jsniper Linux - Hardware 5 07-05-2012 04:46 PM
[SOLVED] how to auto mount a file system on reboot gvsbnarayana Linux - Newbie 6 11-05-2011 09:37 AM
Auto mount USB drive to specified mount point after reboot smallbook Linux - Server 7 07-21-2010 05:40 AM
auto mount after reboot ust Linux - Newbie 2 09-05-2008 02:40 PM
How to auto mount a 2nd hdd Adam555 Linux - Newbie 2 01-22-2008 03:56 AM


All times are GMT -5. The time now is 09:05 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration