Forums

Michael
Michael
Offline
Resolved
0 votes
I will explain this as best I can. after booting the system i create folders in /var/flexshare/share/ and then i mount the drives and partitions to the folders. I then went into /etc/fstab and enter the info in there for all the mounts.

Here is my fstab:
#
# /etc/fstab
# Created by anaconda on Fri Jul 25 05:13:09 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_server-lv_root / ext4 defaults 1 1
UUID=89eae174-3a70-41b2-bdbe-35134246dc9c /boot ext4 defaults 1 2
/dev/mapper/vg_server-lv_swap swap swap defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/sda1 /var/flexshare/shares/bay_1_part_1 ntfs defaults 0 0
/dev/sda5 /var/flexshare/shares/bay_1_part_2 ntfs defaults 0 0
/dev/sdc1 /var/flexshare/shares/ide_1_part_1 ntfs defaults 0 0
/dev/sdd1 /var/flexshare/shares/bay_4_part_1 ntfs defaults 0 0

but when i reboot the /dev/sd?? have all changed so the etc/fstab is now incorrect. How do i get the drives to come up with the same /dev/sd?? after reboot. here is some more info after reboot (it was all matching before reboot):

[root@Server ~]# mount
/dev/mapper/vg_server-lv_root on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
/dev/sda1 on /boot type ext4 (rw)
/dev/sdc1 on /var/flexshare/shares/ide_1_part_1 type fuseblk (rw,allow_other,blksize=4096)
/dev/sdd1 on /var/flexshare/shares/bay_4_part_1 type fuseblk (rw,allow_other,blksize=4096)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)



[root@Server ~]# fdisk -l

Disk /dev/sdb: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x047f047e

Device Boot Start End Blocks Id System
/dev/sdb1 1 9729 78148161 7 HPFS/NTFS

Disk /dev/sdd: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x794b4e2e

Device Boot Start End Blocks Id System
/dev/sdd1 * 1 6375 51207156 7 HPFS/NTFS
/dev/sdd2 6376 30401 192988845 f W95 Ext'd (LBA)
/dev/sdd5 6376 30401 192988813+ 7 HPFS/NTFS

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x18740d8f

Device Boot Start End Blocks Id System
/dev/sdc1 1 60801 488384001 7 HPFS/NTFS

Disk /dev/sda: 61.5 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006ba4c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 7477 59538432 8e Linux LVM

Disk /dev/mapper/vg_server-lv_root: 57.8 GB, 57776537600 bytes
255 heads, 63 sectors/track, 7024 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/vg_server-lv_swap: 3187 MB, 3187671040 bytes
255 heads, 63 sectors/track, 387 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


I understand i am using ntfs drives but i got it all working if things would quit moving. Thanks for the help.
Sunday, August 10 2014, 05:19 AM
Share this post:
Responses (6)
  • Accepted Answer

    Sunday, August 10 2014, 03:37 PM - #Permalink
    Resolved
    0 votes
    Michael, fdisk will only create the partition(s) and add the indicator of the type of file-system to be expected on the partition(s), which is shown by the fdisk "p" command.

    However, you must separately create the file-system itself as the next step on each new partion before it can be mounted... Some-what similar to the DOS/Windows "format" command...
    e.g. "mkfs.ext4 /dev/sdb1" will create an ext4 file-system on partition 1 of /dev/sdb

    use "ls /sbin/mk*.*" to see the various commands...

    You might be doing this, but this step is not mentioned in your append above...
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, August 10 2014, 02:19 PM - #Permalink
    Resolved
    0 votes
    Give the GParted live disk a go and delete the complete partition before creating one (or more) ext4 ones.
    The reply is currently minimized Show
  • Accepted Answer

    Michael
    Michael
    Offline
    Sunday, August 10 2014, 02:07 PM - #Permalink
    Resolved
    0 votes
    i am not necessarily but this used to be an xp pro machine which acted as my file server so all the drives in it are already filled with data that i need to keep. once i get clearos operating properly i will mov the drives over to ext4 but for now i just need it up and running and accessible.

    the drive in question i am trying to make it ext3 or 4 so i can learn how to switch these drives over when i get to that point but i am having no luck reformatting a drive from ntfs to ext3 or 4. this drive is empty so i have nothing to lose with it.

    Thanks for trying i will open a new post on this formatting issue if i don't get it resolved today.

    Thanks again.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, August 10 2014, 01:54 PM - #Permalink
    Resolved
    0 votes
    I don't know fdisk for partitioning. I have only used Parted/GParted.

    Why are you so keen on ntfs? It in not generally considered a good choice in Linux.
    The reply is currently minimized Show
  • Accepted Answer

    Michael
    Michael
    Offline
    Sunday, August 10 2014, 01:43 PM - #Permalink
    Resolved
    0 votes
    Thank you for the quick response. That does seem to have worked.

    My /dev/sda1 does stay the same as it is coded into the fstab file the way you just had me do my others.

    I do have a separate issue which i may have to create a new post unless you can answer it.

    I have an 80G hard drive that i partitioned with fdisk and if i go into fdisk /dev/sdb1 and enter p it does show it as partitioned linux but if i get out of fdisk and do fdisk -l then it shows 1 big hard drive as an ntfs.

    i mounted this drive manually since the code i had entered into fstab was not working and when i mounted it manually and entered the mount command afterwords this is when i noticed it was showing as ext3. i went into the fstab and changed it from ntfs to ext3 then rebooted. it now hangs on reboot and says that line of the fstab is wrong.

    Any ideas. Maybe i should partition it with parted instead. (i read some other posts on parted and it seems to be preferred)

    Thanks again for any help and for resolving my other issue.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, August 10 2014, 09:03 AM - #Permalink
    Resolved
    0 votes
    Do a:
    ls /dev/disk/by-uuid -l
    and note all the UUID -> sdX mappings. Then change your fstab to use UUID's like this line:
    UUID=89eae174-3a70-41b2-bdbe-35134246dc9c /boot ext4 defaults 1 2
    tather than /dev/sdXn. UUIDs are unique to a partition (unless you clone it).

    I don't know if you have another problem which also may cause this remapping. /dev/sda1 is generally your /boot partition (mounted by UUID here) and is quite small. You are also trying to map it into a flexshare. Does /dev/sda5 actually exist as well? What is the output of:
    fdisk -l
    ....and please put the results in [code] tags.
    The reply is currently minimized Show
Your Reply