LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2017, 03:07 PM   #1
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Rep: Reputation: Disabled
can't seem to find my mounts


Hi

I created two mounts. a swap and a ext4 1GB disk mounted on my ubuntu machine.

But I can't seem to see them when I run the mount cmd.
Here is what I did, and here is what I get from the cmd.

Code:
$ cat /proc/swaps
Filename                                Type            Size    Used    Priority
/home/user/swap.img                     file            1023996 0       -1
/dev/sda5                               partition       1046524 0       -2

$ mkfs.ext4 test.img

$ sudo mount -t ext4 test.img test/ -o defaults

$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=56b92ca1-312c-45e6-8f57-8c80762f96b9 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=07d0cb84-79a6-47bd-a155-cbfd045cf6ca none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
/home/user/swap.img swap swap sw 0 0
The output from mount, i was expecting to see both a line for my swap and the disk that I mounted, but I don't see anything that resembles that.
Code:

$ mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
udev on /dev type devtmpfs (rw,nosuid,relatime,size=479324k,nr_inodes=119831,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,noexec,relatime,size=99848k,mode=755)
/dev/sda1 on / type ext4 (rw,relatime,errors=remount-ro,data=ordered)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,size=5120k)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd,nsroot=/)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime)
cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls,net_prio,nsroot=/)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct,nsroot=/)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices,nsroot=/)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset,nsroot=/)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids,nsroot=/)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb,nsroot=/)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio,nsroot=/)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer,nsroot=/)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory,nsroot=/)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event,nsroot=/)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
vmware-vmblock on /run/vmblock-fuse type fuse.vmware-vmblock (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
tmpfs on /run/user/108 type tmpfs (rw,nosuid,nodev,relatime,size=99848k,mode=700,uid=108,gid=114)
gvfsd-fuse on /run/user/108/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=108,group_id=114)
tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=99848k,mode=700,uid=1000,gid=1000)
I didn't put 1G disk in /etc/fstab cause it's just a test, and swap is in /etc/fstab.
Thanks
 
Old 03-02-2017, 03:25 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,589

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
swap is not a regular filesystem and does not show up under mount or the df command. You can look at the output of the free command and see that your total swap size should be the combination of the swap partition and your swap file.

To mount an image file you need to use a loop device i.e.

sudo mount -t ext4 -o loop test.img /mount/point

Last edited by michaelk; 03-02-2017 at 03:27 PM.
 
Old 03-02-2017, 03:29 PM   #3
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch
Posts: 1,253

Rep: Reputation: 467Reputation: 467Reputation: 467Reputation: 467Reputation: 467
I'm having trouble understanding your intentions ... you seem to have defined both a swap partition and a swap file ? Is this true ?

You can't actually mount a swap file system ... so that part doesn't surprise me. But I don't at all understand what you mean concerning the supposed 1 GB disk ...

Some structured background information might be helpful.
 
Old 03-02-2017, 03:48 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,589

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
You can create an empty file, format it and mount it like a regular filesystem. The basic steps in the OP's case:

dd if=/dev/zero of=test.img bs=1G count=1
mkfs -t ext4 test.img
mount -t ext4 -o loop test.img /mount/point

However, I made an assumption and it depends on versions whether or not you need to specify a loop device. Were there any error messages when you tried to mount your 1GB filesystem?
 
Old 03-02-2017, 04:14 PM   #5
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Original Poster
Rep: Reputation: Disabled
hi all

I am just playing around with mounting that's all.

The swap and the 1GB disk are two separate things. I tried to mount a new swap partition and it works.

I then tried to create a file that I called test.img and mounted it like a regular file system.

But when I execute the mount command, I don't see it in the list of entries.
 
Old 03-02-2017, 04:20 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 21,589

Rep: Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163Reputation: 4163
Were there any error or warning messages when you created or tried to mount the image file?
 
Old 03-02-2017, 09:11 PM   #7
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Original Poster
Rep: Reputation: Disabled
no errors, the img files is mounted successfuly. I am just wondering, since it is mounted successfully, I should be able to see it in the output of mount cmd, but all I see is giberish.
 
Old 03-02-2017, 09:12 PM   #8
jzoudavy
Member
 
Registered: Apr 2012
Distribution: Ubuntu, SUSE, Redhat
Posts: 188

Original Poster
Rep: Reputation: Disabled
actually i am really confused now. cause i just rebooted the vm and redid my steps, this time the mount cmd outputted what i expected. this is really weird.
 
  


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
Best way to make NFS mounts easy to find for OpenSuSE 11.2 users unassassinable Linux - Networking 1 10-29-2010 06:50 PM
cd mounts Murph00009 Linux - Hardware 1 01-07-2005 10:57 PM
My / directory only mounts ro cruxx Linux - General 5 08-17-2004 02:33 AM
Can't find file '/proc/mounts' TY2K4 Red Hat 1 01-10-2004 07:39 AM
some help with x and mounts sehris Slackware 4 08-12-2003 02:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:42 PM.

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