LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-18-2013, 12:43 PM   #1
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Rep: Reputation: 30
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.
 
Old 07-18-2013, 01:12 PM   #2
WhiteWolf1776
Member
 
Registered: Oct 2010
Location: Bowling Green, KY
Distribution: Slackware
Posts: 288

Rep: Reputation: 95
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..)

Last edited by WhiteWolf1776; 07-18-2013 at 01:21 PM. Reason: warning about moving files from music, etc.
 
Old 07-18-2013, 01:13 PM   #3
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
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.
 
Old 07-18-2013, 01:19 PM   #4
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 114

Rep: Reputation: 24
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
 
Old 07-18-2013, 02:28 PM   #5
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by NeoMetal View Post
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.
 
Old 07-18-2013, 02:46 PM   #6
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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.

Last edited by Firerat; 07-18-2013 at 02:48 PM.
 
Old 07-18-2013, 03:01 PM   #7
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Firerat View Post
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
 
Old 07-18-2013, 03:09 PM   #8
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
Originally Posted by tigerflag View Post
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}
 
Old 07-18-2013, 03:16 PM   #9
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
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
 
Old 07-18-2013, 03:16 PM   #10
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
Old 07-18-2013, 03:40 PM   #11
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Original Poster
Rep: Reputation: 30
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?
 
Old 07-18-2013, 03:52 PM   #12
Firerat
Senior Member
 
Registered: Oct 2008
Distribution: Debian sid
Posts: 2,683

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
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
 
Old 07-18-2013, 03:58 PM   #13
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Original Poster
Rep: Reputation: 30
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.
 
Old 07-18-2013, 04:08 PM   #14
zhjim
Senior Member
 
Registered: Oct 2004
Distribution: Debian Squeeze x86_64
Posts: 1,748
Blog Entries: 11

Rep: Reputation: 233Reputation: 233Reputation: 233
Quote:
Originally Posted by tigerflag View Post
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 View Post
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 View Post
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.

Last edited by zhjim; 07-18-2013 at 04:10 PM.
 
Old 07-18-2013, 04:21 PM   #15
tigerflag
Member
 
Registered: Aug 2002
Location: Phoenix, AZ
Distribution: PCLinuxOS 2012.08
Posts: 430

Original Poster
Rep: Reputation: 30
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.

Last edited by tigerflag; 07-18-2013 at 04:24 PM. Reason: added PS
 
  


Reply



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
is it required for /bin to be mounted as separate partition?? kirtikjr Linux - Software 3 07-12-2007 05:18 PM
developing on separate partitions mtdew3q SUSE / openSUSE 5 05-18-2007 02:04 PM
e2fsck: root partitions and ro mounted partitions Clemente Linux - General 4 11-06-2006 09:32 PM
Separate Partitions for Separate User groups volvic Slackware - Installation 2 09-16-2004 02:42 AM
how do i separate the partitions...? perry Slackware 2 11-20-2003 03:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:03 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
Open Source Consulting | Domain Registration