Fedora Linux Support Community & Resources Center
  #1  
Old 17th August 2012, 04:23 PM
brianblaze's Avatar
brianblaze Offline
Registered User
 
Join Date: Jun 2012
Location: Montreal
Posts: 112
linuxchrome
Question chroot bootable USB?

Hello fellow helpers!

I have a quick question which seems to have no quick answers... I want to mount my bootable USB and have access to the root of the linux on the USB (chroot)... the problem is when I mount the usb it has the files that are used to automatically boot the USB not the actual root itself... anyone have an idea of how to go about locating the root on my USB? Also fdisk shows the one partition on my usb...

Thanks in advance!
Reply With Quote
  #2  
Old 17th August 2012, 06:06 PM
Skull One's Avatar
Skull One Offline
Registered User
 
Join Date: Jun 2010
Location: Lost...
Posts: 584
linuxredhatmozilla
Re: chroot bootable USB?

I guess it is a live-usb.
You can access the filesystem using three mount commands. Here the steps.

1. Create the mount points:
Code:
mkdir /mnt/liveusb
mkdir /mnt/squashfs
mkdir /mnt/rootfs
2. Mount.
2a. The usb stick first (this can also be done in another way):
Code:
mount /dev/sdb1 /mnt/liveusb
2b. You must have a squashfs filesystem, mount it:
Code:
mount -t squashfs  /mnt/liveusb/LiveOS/squashfs.img  /mnt/squashfs
2c. Mount the root image:
Code:
 mount -o loop /mnt/squashfs/LiveOS/rootfs.img /mnt/rootfs
The root filesystem is now mounted in /mnt/rootfs.

To unmount:
Code:
umount  /mnt/rootfs
umount  /mnt/squashfs
umount  /mnt/liveusb
rmdir  /mnt/rootfs
rmdir  /mnt/squashfs
rmdir  /mnt/liveusb

Of course, adapt the directories to what you have.
__________________
:confused:
Reply With Quote
  #3  
Old 17th August 2012, 06:21 PM
brianblaze's Avatar
brianblaze Offline
Registered User
 
Join Date: Jun 2012
Location: Montreal
Posts: 112
linuxchrome
Re: chroot bootable USB?

Almost perfect! My only problem is that after mounting 2b I get this message
Code:
mount: warning: squashfs/ seems to be mounted read-only.
Any Idea how to have it not read only...

I am looking up this squashfs since this is the first I hear about it THANK YOU!
Reply With Quote
  #4  
Old 17th August 2012, 06:29 PM
jpollard Online
Registered User
 
Join Date: Aug 2009
Location: Waldorf, Maryland
Posts: 6,149
linuxfirefox
Re: chroot bootable USB?

It is a compressed filesystem - it can only be read only as attempting to replace a block would destroy the compression (the replacement would likely be larger than the original).

So, no you can't have it read/write.

You can copy it into an uncompressed separate filesystem though.

See http://tldp.org/HOWTO/SquashFS-HOWTO/
Reply With Quote
  #5  
Old 17th August 2012, 06:35 PM
brianblaze's Avatar
brianblaze Offline
Registered User
 
Join Date: Jun 2012
Location: Montreal
Posts: 112
linuxchrome
Cool Re: chroot bootable USB?

Quote:
Originally Posted by jpollard View Post
It is a compressed filesystem - it can only be read only as attempting to replace a block would destroy the compression (the replacement would likely be larger than the original).

So, no you can't have it read/write.

You can copy it into an uncompressed separate filesystem though.

See http://tldp.org/HOWTO/SquashFS-HOWTO/
Awesome thanks for the help guys... I got some reading to do!!!
Reply With Quote
  #6  
Old 17th August 2012, 06:38 PM
Skull One's Avatar
Skull One Offline
Registered User
 
Join Date: Jun 2010
Location: Lost...
Posts: 584
linuxredhatmozilla
Re: chroot bootable USB?

Squashfs *is* read-only by definition.
You cannot modify a live system in that way. If you want to do it, you will have to unpack the filesystem, make your modifications, and rebuild a new one (for comparison, you can assimilate it as a .iso file).

Edit: whoops! a bit too late!
__________________
:confused:
Reply With Quote
  #7  
Old 17th August 2012, 06:39 PM
brianblaze's Avatar
brianblaze Offline
Registered User
 
Join Date: Jun 2012
Location: Montreal
Posts: 112
linuxchrome
Re: chroot bootable USB?

Quote:
Originally Posted by Skull One View Post
Squashfs *is* read-only by definition.
You cannot modify a live system in that way. If you want to do it, you will have to unpack the filesystem, make your modifications, and rebuild a new one (for comparison, you can assimilate it as a .iso file).

Edit: whoops! a bit too late!
Never too late thanks
Reply With Quote
Reply

Tags
bootable, chroot, usb

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Bootable Live CD from bootable Flash watsonjoshd Installation and Live Media 1 9th November 2010 07:30 AM
Convert bootable .img to bootable .iso Nico1974 Using Fedora 0 11th August 2009 05:59 PM
chroot X11 renaud_labombe Using Fedora 0 14th July 2009 11:08 PM
how to chroot ssh megaprogman Security and Privacy 1 15th January 2005 10:14 PM


Current GMT-time: 02:12 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat