LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Separate partitions mistakenly mounted inside of / (http://www.linuxquestions.org/questions/slackware-14/separate-partitions-mistakenly-mounted-inside-of-4175470088/)

tigerflag 07-18-2013 01:43 PM

Separate partitions mistakenly mounted inside of /
 
(Not sure if this is the best place to post this, but I'm running Salix 13.37 which is essentially Slackware 13.37 with some additional graphical tools, so posted it here. Mods, please move if necessary.)

For some reason, my separate /data and /music partitions have been created as directories inside of / .

/dev/sda1 = / with 10.7 GB. It's a primary, bootable partition. It should have a lot of empty space but is full.

Separate partitions (extended, logical):

/dev/sda5 = /data with 5 GB. For my personal files, instead of using /home.

/dev/sda6 = /music. Should be 94 GB. For music and videos.

Somehow both of these partitions have been mounted INSIDE of /, causing / to become totally full.
/music got allotted 6 GB inside of / ; it is completely filled up.

When I try to mount the partition /dev/sda6 I get the error:

Failed to mount "94G Volume".
mount: wrong fs type, bad option, bad superblock on /dev/sda6,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.

dmsg showed the following error from bootup, so I just removed the "discard" option from the line for /dev/sda6:
Code:

XFS: unknown mount option [discard]
How do I get the system to see and automount /data and /music as separate partitions outside of / ?

Here is fstab:
Code:

/dev/sda7        swap            swap        defaults,discard        0  0
/dev/sda1        /                ext4        noatime,defaults,discard 1  1
/dev/sda5        /data            ext4        auto,user,rw,exec,discard 1  2
/dev/sda6        /music          xfs        noatime,auto,user,rw,exec 1  2
/dev/sr0        /media/dvd      auto        ro,user,auto,unhide  0      0
/dev/sr1        /media/dvd1      auto        ro,user,auto,unhide  0      0
/dev/fd0        /mnt/floppy      auto        noauto,users,rw,umask=00 0  0
devpts          /dev/pts        devpts      gid=5,mode=620  0  0
proc            /proc            proc        defaults        0  0
tmpfs            /dev/shm        tmpfs      defaults        0  0
tmpfs              /tmp              tmpfs      defaults,size=1000m  0  0
#/dev/sr1        /mnt/dvd          auto        auto,users,rw,exec  0  0
#/dev/cdrom      /mnt/cdrom      auto        noauto,owner,ro  0  0

Thanks for your help.

WhiteWolf1776 07-18-2013 02:12 PM

here is my fstab... a single separate mount for /home

/dev/sda3 swap swap defaults 0 0
/dev/sda1 / ext4 defaults 1 1
/dev/sda2 /home ext4 defaults 1 2
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro,comment=x-gvfs-show 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0


not sure why all the options on yours... guess first question is, is music really xfs, etc. maybe try taking some or all of those options off the fstab mount points.

I'd also just try mounting manually to see what errors or warnings show up.

man mount

and follow the directions to see if somehow, something just got partitioned wrong.

oh, just a followup note... be sure you get everything out of /music, etc to a nice safe place as the folder should be empty before you mount the other partition on it... just a thought.

(here's hoping eventually... Salix goes away..)

zhjim 07-18-2013 02:13 PM

I guess you copied some data to /music or /data while they were not mounted at all. At least judging from the error messages.
Right now your 2 extra partitions get mounted to their exclusive directories which are normaly not used by a linux system. So I'm not quite sure what you mean with mounting them outside of /. Maybe mount them within your /home/username/ directory?

To have them automount just edit the /etc/fstab and remove the user option or add the auto option. That should take care of them beeing mounted on boot (without user option) or when you login (auto option).

But before all first get the entries in /etc/fstab correct. So edit the file then do a mount /mount/point/of/partition. And then make sure everything worked out with mount and see where it got mounted.

NeoMetal 07-18-2013 02:19 PM

Wait, are the files that should be on the music and data partitions actually visible/present within the root partition?


Could you post the output of

fdisk -l

and

df -h

tigerflag 07-18-2013 03:28 PM

Quote:

Originally Posted by NeoMetal (Post 4992703)
Wait, are the files that should be on the music and data partitions actually visible/present within the root partition?


Could you post the output of

fdisk -l

and

df -h

Here's the output from fdisk -l and df -h"

Code:

# fdisk -l

Disk /dev/sda: 128.0 GB, 128035676160 bytes
255 heads, 63 sectors/track, 15566 cylinders, total 250069680 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: 0x0000ad3d

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *        2048    24578219    12288086  83  Linux
/dev/sda2        24580096    49156095    12288000  83  Linux
/dev/sda3        49162238  250068991  100453377    5  Extended
/dev/sda5        49162240    59402239    5120000  83  Linux
/dev/sda6        59404288  243724287    92160000  83  Linux
/dev/sda7      243728384  250068991    3170304  82  Linux swap

# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        12G  11G  750M  94% /
/dev/sda5      4.9G  138M  4.5G  3% /data
/dev/sda6        88G  33M  88G  1% /music
tmpfs          3.9G    0  3.9G  0% /dev/shm
tmpfs          1000M  4.0K 1000M  1% /tmp

To clarify, there is nothing in /dev/sda5 /data or in /dev/sda6 /music. /data and /music are (wrongly) mounted in the / filesystem in /dev/sda1.

I don't put documents or data into my /home/tigerflag directory. I use separate partitions flike /data and /music instead, so in a dual-boot setup all my files are accessible from any distro.

If I were to put my docs and music into a partition called /home/tigerflag, then share that partition between distros, different distros's configuration settings would cause problems.

Firerat 07-18-2013 03:46 PM

No, they appear to be mounted correctly.

Anyway, here is what we do

Code:

sudo -
for i in data music;do
    mkdir /mnt/$i
    mount --move /$i /mnt/$i
done
exit

that will move the mountpoints,

Now you can move stuff from /data and /music into /mnt/data /mnt/music

next time you boot, all should be fine
but report back if any problems ( like no files in /data and /music )
and you might need to change owner

Code:

chown <yourUserName>:<yourUserName> /mnt/data/* -R

Edit:
forgot to mention, the mount --move assumes kernel 2.5.1 or greater
Code:

      The move operation.
              Since Linux 2.5.1 it is possible to atomically move a mounted tree to another place. The call is
                    mount --move olddir newdir
              or shortoption
                    mount -M olddir newdir
              This will cause the contents which previously appeared under olddir to be accessed under newdir.  The physical location of the files is not changed.  Note that  the  olddir  has  to  be  a
              mountpoint.


tigerflag 07-18-2013 04:01 PM

Quote:

Originally Posted by Firerat (Post 4992754)
No, they appear to be mounted correctly.

Anyway, here is what we do

Code:

sudo -
for i in data music;do
    mkdir /mnt/$i
    mount --move /$i /mnt/$i
done
exit

that will move the mountpoints,

Now you can move stuff from /data and /music into /mnt/data /mnt/music

next time you boot, all should be fine
but report back if any problems ( like no files in /data and /music )
and you might need to change owner

Code:

chown <yourUserName>:<yourUserName> /mnt/data/* -R

Using kernel 2.6.37 so this should work, but got these error messages:

Code:

# for i in data music;do
> mkdir /mnt/$i
> mount --move /$i /mnt/$i
> done
mkdir: cannot create directory `/mnt/data': File exists
mount: wrong fs type, bad option, bad superblock on /data,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

mkdir: cannot create directory `/mnt/music': File exists
mount: wrong fs type, bad option, bad superblock on /music,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so


Firerat 07-18-2013 04:09 PM

Quote:

Originally Posted by tigerflag (Post 4992770)
Using kernel 2.6.37 so this should work, but got these error messages:

Code:

# for i in data music;do
> mkdir /mnt/$i
> mount --move /$i /mnt/$i
> done
mkdir: cannot create directory `/mnt/data': File exists
mount: wrong fs type, bad option, bad superblock on /data,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so

mkdir: cannot create directory `/mnt/music': File exists
mount: wrong fs type, bad option, bad superblock on /music,
      missing codepage or helper program, or other error
      In some cases useful info is found in syslog - try
      dmesg | tail  or so


guess I should have checked before mkdir, still that is none fatal error..

Ok,

Code:

umount /{data,music}
edit /etc/fstab, ( so it is /mnt/data and /mnt/music )
and then mount
Code:

mount /mnt/{data,music}

zhjim 07-18-2013 04:16 PM

Okay using partitions throughout distribtutions is a total other ballpark then just mounting them in one. I'd say it does not really matter where they get mounted but more how the uid and gid of the filesystem gets translated by the active system. For an example

Code:

[Distro 1]
User: tigerflag
uid: 1000
gid: 1000

[Distro 2]
user: tigerflag
uid: 2000
gid: 2000

Now as the filesystem only has the numbers stored with the file you'll get into trouble writing to existing files when hoping distributions. Solution for me would be either to:

make __absolutly__ sure that the uid and gids are the same for the user.
Use some udev rules to chown stuff
or use acl.

With acl you also get into this uid, gid number thing but for every distribution you just add another acl with the system specific id and should be fine. Taking that double appearing numbers are just silently ignored by acl or you ignore the message about dublicate entries.

As i wrote this you moved on. Just one edition. Please first make sure that the mount is functioning. Get to know the filesystem of the partition and make your head up where you want the partitons to be mounted (even if its just for now.) The mountpoint can be easily changed.

Get the filesystem of the partiton
Code:

file -s /dev/sda5
tune2fs /dev/sda5

one of those should print the fs

Firerat 07-18-2013 04:16 PM

Actually, before you do that...

What is in /mnt/data and /mnt/music ?

You might like to move those files into /data and /music first

tigerflag 07-18-2013 04:40 PM

OK, I'm getting confused. Not sure who is talking to whom. The reason why I use Salix instead of straight Slackware is because I am commandline challenged. It's not from lack of trying to learn. I need instructions to be a little more step-by-step if it's not too much trouble...

Quote:

Actually, before you do that...

What is in /mnt/data and /mnt/music ?

You might like to move those files into /data and /music first
In /mnt/data there is only an empty lost+found directory, because it's formatted ext4.

In /mnt/music (formatted XFS) there is absolutely nothing.

Here is the output for file -s and tune2fs:

Code:

# file -s /dev/sda5
/dev/sda5: Linux rev 1.0 ext4 filesystem data, UUID=546795d9-4c8f-4e89-8bdb-26cc34595082 (needs journal recovery) (extents) (large files) (huge files)

# tune2fs /dev/sda5
tune2fs 1.41.14 (22-Dec-2010)
Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-g group]
    [-i interval[d|m|w]] [-j] [-J journal_options] [-l]
    [-m reserved_blocks_percent] [-o [^]mount_options[,...]]
    [-r reserved_blocks_count] [-u user] [-C mount_count] [-L volume_label]
    [-M last_mounted_dir] [-O [^]feature[,...]]
    [-E extended-option[,...]] [-T last_check_time] [-U UUID]
    [ -I new_inode_size ] device

Firerat, when you say:
Quote:

"edit /etc/fstab, ( so it is /mnt/data and /mnt/music )"
can you please elaborate and tell me exactly how to write that line?

Firerat 07-18-2013 04:52 PM

you see to think /dev/sda5 is mounted to /mnt/data
It is *NOT*, it is mounted to /data
and /dev/sda6 is mounted to /music

Code:

/dev/sda5        /data            ext4        auto,user,rw,exec,discard 1  2
/dev/sda6        /music          xfs        noatime,auto,user,rw,exec 1  2

are you certain nothing is in /mnt/data or /mnt/music ?

Code:

du -hcs /mnt/data /mnt/music
and nothing is in /data /music
Code:

du -hcs /data /music
if you want those two to be mounted in /mnt/data and /mnt/music
then your fstab should look like this

Code:

/dev/sda5        /mnt/data            ext4        auto,user,rw,exec,discard 1  2
/dev/sda6        /mnt/music          xfs        noatime,auto,user,rw,exec 1  2

But there is something not quite adding up.. I'm confused now :)

do you expect anything to be in /data /music /mnt/data or /mnt/music?

in other words are you missing any files?

I won't be around for a while now,
but if you can post the output of
Code:

du -hcs /data /music /mnt/data /mnt/music
I'm sure someone else can pick up on what may need to be done
If not I can help at a later date

tigerflag 07-18-2013 04:58 PM

Code:

# du -hcs /data /music /mnt/data /mnt/music
4.0K    /data
5.8G    /music
152K    /mnt/data
0    /mnt/music
5.8G    total

the 152K in /mnt/data is the lost+found folder. There is nothing in it. All my music files are in /music, not in /mnt/music.

Thanks for explaining how to change /data and /music in fstab to /mnt/data and /mnt/music.

I really appreciate your time and patience.

zhjim 07-18-2013 05:08 PM

Quote:

Originally Posted by tigerflag (Post 4992800)
OK, I'm getting confused. Not sure who is talking to whom. The reason why I use Salix instead of straight Slackware is because I am commandline challenged. It's not from lack of trying to learn. I need instructions to be a little more step-by-step if it's not too much trouble...

We are here brother. Good choice for using the shell (command line). Grants knowledge.

Quote:

Originally Posted by tigerflag (Post 4992800)
In /mnt/data there is only an empty lost+found directory, because it's formatted ext4.

In /mnt/music (formatted XFS) there is absolutely nothing.

Okay so now we can forget about the filesystem mounted there (Beside music having some stuff i it. *edit*). Just need to get sorted if after you unmount them they contain data. See if you mount things on a specific directory everything that was there before is masked. It does not show up. I'm saying this cause you said that the / partiton had a lot of free space. But more on this later.

Quote:

Originally Posted by tigerflag (Post 4992800)
Here is the output for file -s and tune2fs:

Code:

# file -s /dev/sda5
/dev/sda5: Linux rev 1.0 ext4 filesystem data, UUID=546795d9-4c8f-4e89-8bdb-26cc34595082 (needs journal recovery) (extents) (large files) (huge files)

# tune2fs /dev/sda5
tune2fs 1.41.14 (22-Dec-2010)
Usage: tune2fs [-c max_mounts_count] [-e errors_behavior] [-g group]
    [-i interval[d|m|w]] [-j] [-J journal_options] [-l]
    [-m reserved_blocks_percent] [-o [^]mount_options[,...]]
    [-r reserved_blocks_count] [-u user] [-C mount_count] [-L volume_label]
    [-M last_mounted_dir] [-O [^]feature[,...]]
    [-E extended-option[,...]] [-T last_check_time] [-U UUID]
    [ -I new_inode_size ] device

Firerat, when you say:
can you please elaborate and tell me exactly how to write that line?

file -s is enough we know now that its formated with an ext4 filesystem. Enough for getting the mount line going. Please post output of file -s for /dev/sda6. (For tune2fs -l should list infos about the filesystem. check man tune2fs.)

Okay lets do this.
Unmount /dev/sda5 and /dev/sda6. So we get a clean system only file hierachy.
After that do that du -hcs from firerat on /data and /music. We now see if they actually contain data that is saved inside the / partition|filesystem. (The masking I talked about earlier). Or just ls on those dirs.

Lets just get that going before I toss some more at you.

tigerflag 07-18-2013 05:21 PM

Here you go:

Code:

root[tigerflag]# umount /dev/sda5
root[tigerflag]# umount /dev/sda6
root[tigerflag]# du -hcs /data
4.0K    /data
4.0K    total
root[tigerflag]# du -hcs /music
5.8G    /music
5.8G    total

PS- the 4K file in /data was just a test file. No loss if it gets lost. I can even afford to lose all the music in /music- it's easy enough to replace in the proper sda6 /music directory if necessary.

but / containing 5.8G of music is almost completely full.


All times are GMT -5. The time now is 04:08 AM.