Note that there are some explanatory texts on larger screens.

plurals
  1. POAutomount VHD on Azure Ubuntu 12.04LTS machine
    primarykey
    data
    text
    <p>PLEASE READ THE EDIT, BEHAVIOUR HAS CHANGED</p> <p>I have a machine on Microsoft Azure running Ubuntu 12.04LTS. I set up MySQL to have its data folder on an attached 1TB VHD. The problem is that if I reboot/stop the machine, at the startup the disk is not mounted and MySQL service cannot start without human interaction.</p> <p>I followed a guide stating that editing fstab would have done what I need. These are the steps I took (/dev/sdc1 is the drive to automount):</p> <ul> <li>sudo mkdir /mnt/datadrive</li> <li>sudo chown user -R /mnt/datadrive</li> <li><p>sudo blkid</p> <pre><code>/dev/sda1: LABEL="cloudimg-rootfs" UUID="6ae2c935-d4f7-47e8-8be0-23ff41d12ff2" TYPE="ext4" /dev/sdb1: UUID="ad260fa5-200a-4a62-a43a-1aed2d91c01e" TYPE="ext4" /dev/sdc1: UUID="ac28921e-c8aa-4ab2-8422-d985f64c722b" TYPE="ext4" </code></pre></li> <li>sudo cp /etc/fstab /etc/fstab.bak</li> <li><p>sudo nano /etc/fstab</p> <pre><code>UUID=6ae2c935-d4f7-47e8-8be0-23ff41d12ff2 / ext4 defaults,discard 0 0 </code></pre></li> <li><p>I added the following line</p> <pre><code>UUID=ac28921e-c8aa-4ab2-8422-d985f64c722b /mnt/datadrive ext4 defaults 0 2 </code></pre></li> <li><p>sudo mount /dev/sdc1 /mnt/datadrive</p></li> </ul> <p>NOT ANYMORE After a reboot I can't find the new mounting point and the new drive and I have to redo the procedure.</p> <p>What should I do?</p> <p><strong>EDIT</strong>: I don't think I really changed anything, but the behaviour has changed. I tried putting these instructions inside /etc/init.d/mysql as the first lines below:</p> <pre><code>#!/bin/sh -e # upstart-job # # Symlink target for initscripts that have been converted to Upstart. mkdir /mnt/datadrive &lt;--- inserted line chown user -R /mnt/datadrive &lt;--- inserted line mount /dev/sdc1 /mnt/datadrive &lt;--- inserted line set -e INITSCRIPT="$(basename "$0")" JOB="${INITSCRIPT%.sh}" </code></pre> <p>but nothing changed so I removed them. Now the behaviour I'm encountering is the following:</p> <ul> <li><p>At every reboot <strong>df</strong> gives the following output:</p> <pre><code>user@Database:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 30235684 1115576 27584520 4% / udev 1754596 8 1754588 1% /dev tmpfs 705376 240 705136 1% /run none 5120 0 5120 0% /run/lock none 1763432 0 1763432 0% /run/shm /dev/sdc1 139334632 192000 132064848 1% /mnt/datadrive &lt;--- suspect line /dev/sdb1 139334632 192000 132064848 1% /mnt </code></pre></li> <li><p>If I check the content in /mnt/datadrive I find out that there's nothing. The strange thing is that sdb1 and sdc1 sizes are the same, even though sdc1 should be TEN times larger, as pointed out in <strong>fdisk -l</strong></p> <pre><code>user@Database:~$ sudo fdisk -l Disk /dev/sdb: 145.0 GB, 144955146240 bytes Device Boot Start End Blocks Id System /dev/sdb1 * 2048 283113471 141555712 83 Linux Disk /dev/sda: 31.5 GB, 31457280000 bytes Device Boot Start End Blocks Id System /dev/sda1 * 2048 61439999 30718976 83 Linux Disk /dev/sdc: 1073.7 GB, 1073741824000 bytes Device Boot Start End Blocks Id System /dev/sdc1 2048 2097151999 1048574976 83 Linux </code></pre></li> <li><p>So I try to unmount the drive, and this is the message I get:</p> <pre><code>user@Database:~$ sudo umount /dev/sdc1 umount: /mnt/datadrive: not mounted </code></pre></li> <li><p>I proceed to re-mount the drive and the content is back where it should be:</p> <pre><code>user@Database:~$ sudo mount /dev/sdc1 /mnt/datadrive user@Database:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 30235684 1115572 27584524 4% / udev 1754596 12 1754584 1% /dev tmpfs 705376 240 705136 1% /run none 5120 0 5120 0% /run/lock none 1763432 0 1763432 0% /run/shm /dev/sdb1 139334632 192000 132064848 1% /mnt /dev/sdc1 1032122112 2322896 977370468 1% /mnt/datadrive user@Database:/mnt$ cd datadrive/ user@Database:/mnt/datadrive$ ll total 28 drwxr-xr-x 4 root root 4096 Oct 17 13:56 ./ drwxr-xr-x 4 root root 4096 Oct 18 10:35 ../ drwx------ 2 root root 16384 Oct 17 13:16 lost+found/ drwx------ 6 mysql mysql 4096 Oct 18 13:07 mysql/ </code></pre></li> </ul> <p>As asked this is the content of dmesg:</p> <pre><code>user@Database:/mnt/datadrive$ dmesg | grep sdc1 [ 7.383227] sdc: sdc1 [ 12.920160] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) </code></pre> <p>This is the content of /var/log/syslog:</p> <pre><code>user@Database:/mnt/datadrive$ cat /var/log/syslog | grep sdc Oct 17 13:12:39 Database kernel: [ 189.913966] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 17 13:12:39 Database kernel: [ 189.914087] sd 5:0:0:0: [sdc] Write Protect is off Oct 17 13:12:39 Database kernel: [ 189.914091] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 17 13:12:39 Database kernel: [ 189.914670] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 17 13:12:39 Database kernel: [ 189.928972] sdc: unknown partition table Oct 17 13:12:39 Database kernel: [ 189.930514] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 17 13:15:05 Database kernel: [ 335.429660] sdc: sdc1 Oct 17 13:17:18 Database kernel: [ 468.674639] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 07:36:48 Database kernel: [ 7.197186] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 07:36:48 Database kernel: [ 7.197278] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 07:36:48 Database kernel: [ 7.197281] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 07:36:48 Database kernel: [ 7.197800] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 07:36:48 Database kernel: [ 7.263289] sdc: sdc1 Oct 18 07:36:48 Database kernel: [ 7.267098] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 07:54:16 Database kernel: [ 1073.614800] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 09:09:29 Database kernel: [ 7.182102] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 09:09:29 Database kernel: [ 7.185945] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 09:09:29 Database kernel: [ 7.188352] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 09:09:29 Database kernel: [ 7.189938] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 09:09:29 Database kernel: [ 7.323580] sdc: sdc1 Oct 18 09:09:29 Database kernel: [ 7.326422] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 09:09:29 Database kernel: [ 18.002339] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 10:13:55 Database kernel: [ 7.159946] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 10:13:55 Database kernel: [ 7.170763] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 10:13:55 Database kernel: [ 7.176177] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 10:13:55 Database kernel: [ 7.176383] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 10:13:55 Database kernel: [ 7.215562] sdc: sdc1 Oct 18 10:13:55 Database kernel: [ 7.219238] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 10:13:55 Database kernel: [ 18.191887] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 10:44:49 Database kernel: [ 7.233852] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 10:44:49 Database kernel: [ 7.235373] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 10:44:49 Database kernel: [ 7.235376] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 10:44:49 Database kernel: [ 7.235925] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 10:44:49 Database kernel: [ 7.248451] sdc: sdc1 Oct 18 10:44:49 Database kernel: [ 7.259530] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 10:44:49 Database kernel: [ 13.232100] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 10:55:25 Database kernel: [ 7.306546] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 10:55:25 Database kernel: [ 7.313693] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 10:55:25 Database kernel: [ 7.317388] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 10:55:25 Database kernel: [ 7.318786] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 10:55:25 Database kernel: [ 7.328576] sdc: sdc1 Oct 18 10:55:25 Database kernel: [ 7.331773] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 10:55:25 Database kernel: [ 12.928273] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 11:02:04 Database kernel: [ 7.299162] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 11:02:04 Database kernel: [ 7.299297] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 11:02:04 Database kernel: [ 7.299300] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 11:02:04 Database kernel: [ 7.299644] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 11:02:04 Database kernel: [ 7.319084] sdc: sdc1 Oct 18 11:02:04 Database kernel: [ 7.324219] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 11:02:04 Database kernel: [ 12.966666] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 12:35:53 Database kernel: [ 7.305691] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 12:35:53 Database kernel: [ 7.310663] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 12:35:53 Database kernel: [ 7.313175] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 12:35:53 Database kernel: [ 7.313367] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 12:35:53 Database kernel: [ 7.321665] sdc: sdc1 Oct 18 12:35:53 Database kernel: [ 7.324551] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 12:35:53 Database kernel: [ 13.060708] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 13:03:49 Database kernel: [ 7.322321] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 13:03:49 Database kernel: [ 7.331669] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 13:03:49 Database kernel: [ 7.331672] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 13:03:49 Database kernel: [ 7.335565] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 13:03:49 Database kernel: [ 7.341324] sdc: sdc1 Oct 18 13:03:49 Database kernel: [ 7.358456] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 13:04:36 Database kernel: [ 61.799518] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) Oct 18 13:07:36 Database kernel: [ 7.350049] sd 5:0:0:0: [sdc] 2097152000 512-byte logical blocks: (1.07 TB/1000 GiB) Oct 18 13:07:36 Database kernel: [ 7.357099] sd 5:0:0:0: [sdc] Write Protect is off Oct 18 13:07:36 Database kernel: [ 7.362278] sd 5:0:0:0: [sdc] Mode Sense: 0f 00 10 00 Oct 18 13:07:36 Database kernel: [ 7.368257] sd 5:0:0:0: [sdc] Write cache: enabled, read cache: enabled, supports DPO and FUA Oct 18 13:07:36 Database kernel: [ 7.383227] sdc: sdc1 Oct 18 13:07:36 Database kernel: [ 7.385808] sd 5:0:0:0: [sdc] Attached SCSI disk Oct 18 13:07:36 Database kernel: [ 12.920160] EXT4-fs (sdc1): mounted filesystem with ordered data mode. Opts: (null) </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload